ruby on rails - Heroku migration Memory quota exceeded -


while running migration looks this:

def   filethumb.destroy_all # delete existing thumbnails   file.update_all(thumbs_completed: false) # reset process flags   file.find_each |file|     file.delay(priority: 8).create_thumbs # delay thumbnail creation of each file.   end end 

i'm getting memory quote exceeded

heroku/run.8084:  source=run.8084 dyno=heroku.3498745.1deecee6-afd0-466a-8020-38273704608c sample#load_avg_1m=0.00 sample#load_avg_5m=0.00 sample#load_avg_15m=0.02  heroku/run.8084:  source=run.8084 dyno=heroku.3498745.1deecee6-afd0-466a-8020-38273704608c sample#memory_total=571.66mb sample#memory_rss=511.89mb sample#memory_cache=0.00mb sample#memory_swap=59.78mb sample#memory_pgpgin=1811564pages sample#memory_pgpgout=1680521pages  heroku/run.8084:  process running mem=571m(111.7%)  heroku/run.8084:  error r14 (memory quota exceeded)  

this because of many objects getting created in migration have changed query less memory used. answer of question in question :heroku error r14 (memory quota exceeded): how solve this?

more specifically, fix should be...

def   filethumb.destroy_all # delete existing thumbnails   file.update_all(thumbs_completed: false) # reset process flags   file.find_in_batches(batch_size: 100) |group|     group.each {|file| file.delay(priority: 8).create_thumbs} # delay thumbnail creation of each file.   end end 

Comments

Post a Comment