I have a parser class that is written for parsing xml files and import data to DB. During parsing I collect dozen of objects for import(avg. 60_000) into one array and insert all of them at one time. After operation finished RAM doesn't rollback to previous state. So, after few parsing operations my RAM totally runs out. I try to figure out why memory doesn't clean up from finished process.
Stack:
- ruby 2.2.1
- rails 4.2.4
- nokogiri 1.6.6.2
- activerecord 4.2.4
- activerecord-import 0.10.0
I'm inexperienced in this field and don't know where to start. So, I appreciate any help.