vm 大小(任务管理器)与 java 应用程序堆大小
我想在 Java 1.5 应用程序中查找内存泄漏。我使用 JProfiler 进行分析。 我使用 Windows 任务管理器看到我的应用程序的虚拟机大小约为 790000KB(从大约 300000KB 增加)。在探查器中,我看到分配的堆为 266MB(也在增加)。
也许这是一个菜鸟问题,但是,除了堆之外,还有什么可以占用如此多的内存,使其达到大约 700MB 虚拟机大小(或私有字节大小)?
我提到,根据 这里相当多的内存,但我认为在 700MB 之前仍然有一些空间。顺便问一下,如何查看线程堆栈占用了多少内存?
谢谢。
I want to find a memory leak in a Java 1.5 application. I use JProfiler for profiling.
I see using the windows' task manager that the vm size for my application is about 790000KB (increased from approx 300000KB). In the profiler I see that that the allocated heap is 266MB (increasing also).
Probably it's a rookie question but, what else can occupy so much memory besides the heap so that it goes to approx 700MB vm size (or private bytes size)?
I mention that there are approx 1200 threads running, which can occupy, according to an answer from here quite some memory, but I think there still is some space until 700MB. By the way, how I can see how much memory the threads stacks occupy?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JVM 可以使用大量虚拟内存,但可能不使用常驻内存。启动时,它会分配堆,并映射到其共享库中。加载的类使用 Perm Gen 空间。应用程序可以使用与堆最大值一样大的直接内存。创建每个线程时,会为每个线程分配一个堆栈。在每种情况下,直到使用该内存之前,它可能不会分配给应用程序,即不使用物理内存。随着应用程序的预热,更多的虚拟内存可以变成物理内存。
如果您认为您的 JVM 运行效率不高,我首先会尝试的是 Java 6,自上次发布 Java 5.0 以来,它已经进行了许多修复和改进。
The JVM can use alot of virtual memory which may not use resident memory. On startup it allocates the heap, and maps in its shared libraries. Classes which are loaded use Perm Gen space. An application can use direct memory which can be as large as the heap maximum. As each thread is created a stack is allocated for each thread. In each case until this memory is used, it might not be allocated to the application i.e. not use physical memory. As the application warms up, more of the virtual memory can become physical memory.
If you believe your JVM is not running efficiently, the first thing I would try is Java 6 which has had many fixes and improvements since the last release of Java 5.0.