RubyArray keeps references to unreachable RubyObjects after clear, reject!, 
delete and delete_at
------------------------------------------------------------------------------------------------

                 Key: JRUBY-2711
                 URL: http://jira.codehaus.org/browse/JRUBY-2711
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1.2
         Environment: Mac OS X 10.5.3; J2SE 5.0
            Reporter: Micah Alles
         Attachments: ruby_array_element_removal_dereference.patch

RubyArrays don't explicitly dereference elements that are removed for 
Array#clear and leave extra references to other elements in the backing values 
array as the elements are shifted about in the reject!, delete and delete_at 
implementations.  This causes memory leaks in our application as we rely on 
Array#clear and Array#delete(_at|_if) to remove references to objects so they 
may be collected.

Attached is a patch that removes unneeded references to RubyObjects in 
RubyArray's values array for clear, reject!, delete and delete_at.  The patch 
also includes 4 java unit tests; there is one test for each method which assert 
invalidated values entries are set to null.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to