iamfmjk / etsy

A friendly Ruby interface to the Etsy API
https://github.com/kytrinyx/etsy
MIT License
171 stars 113 forks source link

Very High Memory Usage #99

Closed sealabcore closed 8 years ago

sealabcore commented 9 years ago

This gem uses up 18% of my system memory on a 4gb server... Still trying to decide if it's how my code is using the gem... or the gem itself. Has anybody seen spikes in memory usage from this gem? Most of our importing is done via Delayed Jobs.

kytrinyx commented 9 years ago

I haven't used the gem for quite some time (three years or so?), and I can't remember what the memory profile of the app was.

Are you using the "models", or just going straight to the Request object?

sealabcore commented 9 years ago

I'm using the models. And including a lot... for example:

Etsy::Transaction.find_all_by_shop_id(etsy_shop_ext_id, {access_token: etsy_account.token,
                                                                                             access_secret: etsy_account.secret,
                                                                                             page: page, limit: per_page,
                                                                                              includes: [{resource: "Listing"},
                                                                                                              {resource: "Buyer/Profile"},
                                                                                                              {resource: "Receipt"},
                                                                                                              {resource: "MainImage"}]})
sealabcore commented 9 years ago

@kytrinyx I'm thinking of having my team look into it in the next few weeks. I will keep everyone updated on this thread if we find anything.

kytrinyx commented 9 years ago

I'd definitely appreciate hearing back. I used the Request directly, never the models. I also started experimenting with a new DSL (it's in a branch; by the time I finished my experiment I was no longer working against the Etsy API).

sealabcore commented 8 years ago

I ended up just writing my own lightweight library that only uses certain includes / fields and uses the parsed JSON response directly. Seems to be working for me, for now :)

Closing this issue. The memory leak only happened on a full store import anyways.

kytrinyx commented 8 years ago

Nice, thanks for the update.