Forum: Ruby on Rails validates_associated memory issue

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andy R. (Guest)
on 2007-02-24 14:28
I have a basic script on a RoR site that parses a set of data and adds
it to my DB.  At the end of the script I save a collection of
ActiveRecord objects.  This innocuous-looking piece of code was eating
up memory at an alarming rate - up to 1.5 GB of memory.  It turns out
the culprit was a "validates_associated" validation.

Has anyone experienced this before?  My understanding of ruby's garbage
collection is limited, but is it possible that the objects used in the
validation are not freed until the script is done?  If so, why not?

Any help would be appreciated.

Thanks,
AR
This topic is locked and can not be replied to.