<< memory leak with jruby on glassfish

Bug #374923 reported by Robert Painter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ActiveRDF
New
Undecided
Unassigned

Bug Description

We are using jruby (tried 1.1.6 and 1.3RC1) and deploying as a war on Glassfish. The use of instance_eval and instance_exec in the get_predicate method of objectmanager\resource.rb appears to cause a memory leak. These functions appear to be used to add the << method to whatever object is being returned.

  Under tests that load a lot of object from the TS but doesn't keep them, the number of loaded classes increases rapidly ( > 100,000) and never appears to plateau and very few classes ever seem to be unloaded ( < 500) also the "PS Old Gen" space of the heap eventually runs out and GC fails to clean up. Glassfish then crashes.

I replaced the use of instance_exec with two calls to instance_variable_set. This must have cleaned up a reference to the classes because the GC appeared to work better and Glassfish crashes were less frequent. However a large number of classes still loaded and even though they were now unloading, Glassfish still crashed.

So I commented out all the code used to add the << method to the object. Now the GC works great and the number of loaded classes barely rises above the fresh deployment state and plateaus. Glassfish hasn't crashed under our test since removing that code.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.