开发者

Meaning of the "Unloading class" messages

开发者 https://www.devze.com 2022-12-30 02:13 出处:网络
Anyone can explain why the lines below appear in the output console at runtime ? (one possible answer would be full permGen, but this can be ruled out since the program only uses 24MB out of the max1

Anyone can explain why the lines below appear in the output console at runtime ?

(one possible answer would be full permGen, but this can be ruled out since the program only uses 24MB out of the max100MB available in PermGen)

[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor28]

[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor14]

[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor4]

[Unloading class sun.reflect.GeneratedMethodAccessor5]

[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor38]

[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor36]

[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor22]

[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor8]

[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor39]

[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor16]

[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor2]

[Unloading class sun.reflect.GeneratedConstructorAccessor1]

The program runs with the following params:

-Xmx160M

-XX:MaxPermSize=96M

-XX:PermSize=96M

-XX:+UseConcMarkSweepGC

-XX:+UseParNewGC

-XX:+PrintGCTaskTimeStamps

-XX:+PrintHeapAtGC

-XX:+PrintTenuringDistribution

-XX:+PrintGCDetails

-XX:+PrintGCDateStamps

-XX:+PrintGCTimeStamps

-verbose:gc

-Xlo开发者_如何学JAVAggc:/logs/gc.log

There's plenty of space in the heap and in permGen.


Those classes are hold as softreferences which are always eligible for GC. The GC does not per se only run when the max memory is reached, it will also run when there is room for it, if you understand what I mean.

Those classes are by the way used "under the hoods" of the Serialization API which uses reflection to access fields and invoke methods.


Update: as to logging the class unloading to stdout instead of the path as specified in -Xloggc, there has been a bugreport for exactly this problem: Bug ID 6637203. This was fixed 4 months back. Upgrade your JVM to the latest.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号