Ruby paging over API response dataset causes memory spike
问题 I'm experiencing an issue with a large memory spike when I page through a dataset returned by an API. The API is returning ~150k records, I'm requesting 10k records at a time and paging through 15 pages of data. The data is an array of hashes, each hash containing 25 keys with ~50-character string values. This process kills my 512mb Heroku dyno. I have a method used for paging an API response dataset. def all_pages value_key = 'values', &block response = {} values = [] current_page = 1 total