This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Someone registers thousands of Object's and MethodRef's (was/is: gc times doubling)
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