RubyHash view objects should be static
--------------------------------------

                 Key: JRUBY-5430
                 URL: http://jira.codehaus.org/browse/JRUBY-5430
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.6RC1
            Reporter: Chris K. Jester-Young
            Priority: Minor
         Attachments: RubyHash.diff, RubyHash.html

{{RubyHash}} currently holds three views as non-static: {{VALUE_VIEW}}, 
{{DIRECT_ENTRY_VIEW}}, and {{ENTRY_VIEW}}. As far as I can tell, there is no 
reason for them to be non-static, since the other three views 
({{DIRECT_KEY_VIEW}}, {{KEY_VIEW}}, and {{DIRECT_VALUE_VIEW}}) are already 
static.

The main consequence of these views being non-static is that new instances are 
created for, _and hold live references to_, each new {{RubyHash}} instance. 
I've attached a fasthat histogram that demonstrates this (the views show up as 
{{RubyHash$30}}, {{RubyHash$31}}, and {{RubyHash$32}}).

Granted, each of these views don't by themselves take up a lot of memory, but 
nevertheless, they are unnecessary, they do add up, and (by hogging up the top 
three lines of the histogram pretty much all the time) they are a distraction 
to finding out which classes are really using all the {{RubyHash}} instances.

Attached is a diff that addresses this.

-- 
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