Someone registers thousands of Object's and MethodRef's (was/is: gc times doubling)
Bryce McKinlay
mckinlay@redhat.com
Fri Mar 31 19:23:00 GMT 2006
Martin Egholm Nielsen wrote:
>> Instead of using an Object to represent empty slots, we could use
>> "null" to represent empty slots and an Object to represent the "null"
>> key. This would at least avoid the Array.fill() calls, and it sounds
>> like it should be more efficient for marking too.
> I reckon that too, yes.
> However, I'm little afraid of doing so due to the note "Package
> visible for use by nested classes".
Don't worry about that, this comment is just to remind us that the
package visibility is there to improve performance when it is accessed
by keySet, IdentityIterator, etc.
> In my situation, a stacktrace is seldom (if ever) needed - unless I
> misinterpret the term "stacktrace" as being only the stuff comming
> from "printStackTrace()" on an Exception?!
Yes, there are various places, other than Exceptions, where stack
inspection is needed. Often, a method needs to find out who called it.
Security checks are one example, but there are others. eg:
ResourceBundle does this in order to determine what classloader should
be used to load a resource.
Bryce
More information about the Java
mailing list