简体   繁体   English

Java中加载的类数

[英]Number of classes loaded in java

I have program that the number of classes loaded there is constantly rising. 我的程序中加载的类数量在不断增加。

How could this actually be ? 实际上怎么可能呢? Or do i misunderstand something in java about classloading? 还是我误解了Java中有关类加载的某些内容?

Here is a snippet from jConsole overnight : 这是jConsole的一小段内容:

alt text http://img200.imageshack.us/img200/200/classesp.jpg 替代文字http://img200.imageshack.us/img200/200/classesp.jpg

Could someone please tell me what could be the possible reason for such a constant classloading growth ? 有人可以告诉我,这样的类负载持续增长的可能原因是什么? Or is this normal ? 还是正常?

Thanks 谢谢

What sort of features does your application have that are out-of-the-ordinary as regards class loading? 关于类加载,您的应用程序具有哪些非常规的功能? For example: 例如:

  • are you constantly loading classes from remote sources (eg RMI )? 您是否不断从远程源(例如RMI )加载类?
  • are you using your own ClassLoader ? 您在使用自己的ClassLoader吗?
  • are you using the Java Proxy mechanism to create classes on the fly? 您是否正在使用Java Proxy机制动态创建类?

You could have a class loader leak. 您可能会发生类加载器泄漏。 Read here for example. 例如在这里阅读。

You can use other profilers to know exactly what java objects are in memory (and verify that there is no memory leak) : 您可以使用其他探查器确切地知道内存中有哪些Java对象(并验证没有内存泄漏):

  • List TPTP (Eclipse plugin) 列出TPTP(Eclipse插件)
  • List Netbeans profiler (very good profiler) 列出Netbeans探查器(非常好的探查器)
  • List JProbe profiler (not free) 列出JProbe分析器(不是免费的)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM