Class loader leak?

1,096 views
Skip to first unread message

Renier

unread,
Mar 31, 2011, 9:33:28 AM3/31/11
to jni4net
Hi Pavel,

I found that calling java.lang.System.gc(); explicitly causes the
"Total Loaded" classes to grow every time it is called (and after
classes were unloaded) when monitoring with jconsole.

By selecting the "Verbose Output" on the Classes tab inside jconsole I
notice the following pattern:
[Loaded sun.reflect.GeneratedSerializationConstructorAccessor66 from
__JVM_DefineClass__]
[Loaded sun.reflect.GeneratedSerializationConstructorAccessor67 from
__JVM_DefineClass__]
[Loaded sun.reflect.GeneratedSerializationConstructorAccessor68 from
__JVM_DefineClass__]
[Loaded sun.reflect.GeneratedSerializationConstructorAccessor69 from
__JVM_DefineClass__]

[Unloading class
sun.reflect.GeneratedSerializationConstructorAccessor66]
[Unloading class
sun.reflect.GeneratedSerializationConstructorAccessor69]
[Unloading class
sun.reflect.GeneratedSerializationConstructorAccessor68]
[Unloading class
sun.reflect.GeneratedSerializationConstructorAccessor67]

Is this something to be concerned about?
If I do not call java.lang.System.gc() the "Total Loaded" and "Loaded"
classes stays more stable and rarely goes up.

Is there something I can do to not have the
GeneratedSerializationConstructorAccessor unloaded?

Thanks.

Pavel Šavara

unread,
Mar 31, 2011, 10:51:17 AM3/31/11
to jni...@googlegroups.com
Google found this:

"These classes are part of the reflection mechanism. Since around Java
1.3 reflection has been implemented by generating classes to perform
the access. It's much faster use, but takes longer to create and
upsets the permanent generation."
http://stackoverflow.com/questions/2971019/how-to-avoid-generatedserializationconstructoraccessor-problems

I have no opinion yet.
Cheers
Pavel

> --
> You received this message because you are subscribed to jni...@googlegroups.com
> http://groups.google.com/group/jni4net?hl=en-GB?hl=en-GB
> http://jni4net.sf.net/
>

Reply all
Reply to author
Forward
0 new messages