[英]How do you diagnose a leak in C memory caused by a Java program?
I'm working on a large application (300K LOC) that is causing a memory leak in the Sun 1.6 JVM (1.6_05). 我正在处理一个在Sun 1.6 JVM(1.6_05)中导致内存泄漏的大型应用程序(300K LOC)。 Profiling the Java shows no leak. 分析Java显示没有泄漏。 Are there any diagnostics available from the JVM that might detect the cause of the leak? JVM中是否有可用于检测泄漏原因的诊断信息?
I haven't been able to create a simple, isolated Java test case. 我无法创建一个简单,孤立的Java测试用例。 Is the only way to figure this out by using a C heap analyzer on the JVM? 通过在JVM上使用C堆分析器来解决这个问题的唯一方法是什么?
The application creates a pool of sockets and does a significant amount of network I/O. 该应用程序创建一个套接字池并执行大量的网络I / O.
Some profiler like profiler4j can show the managed and the unmanaged memory (live curve). 像profiler4j这样的一些分析器可以显示托管和非托管内存(实时曲线)。 Then you can see if you has a leak and when the leak occur. 然后,您可以查看是否有泄漏以及何时发生泄漏。 But you does not find more informations. 但是你找不到更多的信息。
After this there are 2 possible solutions: 在此之后有两种可能的解决方案:
I love valgrind ( http://valgrind.org/ ), if you are executing it on a system it supports. 我喜欢valgrind( http://valgrind.org/ ),如果你在它支持的系统上执行它。 It really rocks! 它真的很摇滚!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.