Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 JConsole 监控我的应用程序,我发现总卸载类不时增加。并且堆大小和使用的堆也在增加。一段时间后,我的应用程序崩溃了。
有谁知道为什么会这样?这是否意味着存在类似内存泄漏的情况?
谢谢你
我不认为这是内存泄漏。您是否看到 jconsole 中的堆使用量有所增加?在类加载器被 GC(或)那些指定为软引用的类的情况下,可能会发生类卸载。这里有几个关于为什么会发生类卸载的有趣讨论link1和link2。