Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

When do sun.reflect.GeneratedMethodAccessor objects get loaded?

807606Apr 12 2007 — edited May 21 2007
A little main() method that does nearly nothing:

public static void main(String[] args) throws Exception {
while(true) {
Thread.sleep(1000);
}
}

When I watch this with jconsole, tab "Classes" with verbose output, I see this:

[Loaded sun.reflect.GeneratedMethodAccessor8 from __JVM_DefineClass__]
[Loaded sun.reflect.GeneratedMethodAccessor9 from __JVM_DefineClass__]
[Loaded sun.reflect.GeneratedMethodAccessor10 from __JVM_DefineClass__]
[Loaded sun.reflect.GeneratedMethodAccessor11 from __JVM_DefineClass__]
[Loaded sun.reflect.GeneratedMethodAccessor12 from __JVM_DefineClass__]
[Loaded sun.reflect.GeneratedMethodAccessor13 from __JVM_DefineClass__]
[Loaded sun.reflect.GeneratedMethodAccessor14 from __JVM_DefineClass__]
[Loaded sun.reflect.GeneratedMethodAccessor15 from __JVM_DefineClass__]
[Loaded sun.reflect.GeneratedMethodAccessor16 from __JVM_DefineClass__]

This will continue. Why? What are these classes needed for?

Background: I'm currently searching for a Perm Gen memory leak in a jboss / faces / seam app. I notice that a lot GeneratedMethodAccessor get defined but not garbage collected (even if I force it). Curious what I had to look for I wrote a very simple program that used reflection to invoke methods and tracked it similarly. After a while I noticed that even without reflection all these Accessors get defined.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2007
Added on Apr 12 2007
2 comments
3,254 views