I have a simple ActiveRecord model called Student
with 100 records in the table. I do the following in a rails console session:
ObjectSpace.each_obj
i do not know the answer
But i tried inspecting the heap as given on http://blog.headius.com/2010/07/browsing-memory-jruby-way.html
Have attached a screenshot at, https://skitch.com/deepak_kannan/en3dg/java-visualvm it was a simple program
class Foo; end
f1 = Foo.new
f2 = Foo.new
GC.start
Then used jvisualvm as given above. Was running this in irb.
Seems as if jruby is tracking the object's scope. The object will not get GC'ed if there are any non-weak references to that object