“卸载类”的含义消息 [英] Meaning of the "Unloading class" messages

查看:168
本文介绍了“卸载类”的含义消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以解释为什么下面的行在运行时出现在输出控制台中?

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

(一个可能的答案是完全permGen,但这可以统治因为该程序仅使用PermGen中可用的max100MB中的24MB)

[卸载类sun.reflect.GeneratedSerializationConstructorAccessor28]

[卸载类sun.reflect.GeneratedSerializationConstructorAccessor14]

[卸载类sun.reflect.GeneratedSerializationConstructorAccessor4]

[卸载类sun.reflect.GeneratedMethodAccessor5]

[卸载class sun.reflect.GeneratedSerializationConstructorAccessor38]

[卸载类sun.reflect.GeneratedSerializationConstructorAccessor36]

[卸载类sun.reflect.GeneratedSerializationConstructorAccessor22]

[卸载类sun .reflect.GeneratedSerializationConstructorAccessor8]

[卸载类sun.reflect.GeneratedSerializationConstruc torAccessor39]

[卸载类sun.reflect.GeneratedSerializationConstructorAccessor16]

[卸载类sun.reflect.GeneratedSerializationConstructorAccessor2]

[卸载类sun.reflect.GeneratedConstructorAccessor1]

[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

-Xloggc:/logs/gc.log

-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
-Xloggc:/logs/gc.log

堆和permGen中有足够的空间。

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

推荐答案

这些类保持为 softreferences 总是e适用于GC。当达到最大内存时,GC本身不会 运行,如果你理解我的意思,它也会在有空间的情况下运行。

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.

顺便说一下,这些类是在序列化API的引擎盖下使用的,它使用反射来访问字段并调用方法。

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

更新:关于将类卸载到stdout而不是 -Xloggc 中指定的路径,已经有了针对此问题的错误报告:错误ID 6637203 。 4个月后修复了这个问题。将JVM升级到最新版本。

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.

这篇关于“卸载类”的含义消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆