메모리 누수가 발생했으며 여기에 세부 사항이 있습니다.힙 분석 후 Java 힙 덤프와 힙 크기가 다릅니다.
At the time of after-leak,
- top shows 50GB memory as residential
- heap dump file size is 25GB
- eclipse MAT analyzer tells me the heap size is 10GB
At the time of before-leak,
- top shows 30GB memory as residential
- heap dump file size is 20GB
- eclipse MAT analyzer tells me the heap size is 10GB
위로, 힙 덤프 크기 및 실제 힙 크기의 차이에 놀랐습니다. 상단과 힙의 차이점은 가비지 수집기 힙 및 원시 힙 영역의 가능성이라고 생각합니다. 그러나 힙 덤프 파일 크기와 실제 힙 크기 (eclipse MAT 분석기 사용)는 어떻게 다를 수 있습니까?
이 문제에 대한 통찰력이 있으십니까?
UPDATE/답변
제안 중 일부는 웹 사이트가 "기본 메모리 추적을"지시로 (https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr007.html)을 jcmd 사용한다. 주의 깊게 페이지를 참조한다면, 당신은
Since NMT doesn't track memory allocations by non-JVM code,
you may have to use tools supported by the operating system
to detect memory leaks in native code.
그래서, 네이티브 라이브러리 내부 누출의 경우, 옵션 jcmd하지 않습니다 볼 수 있습니다.
며칠 동안 Internet을 크롤링하고 다양한 프로파일 러를 사용해 본 결과,이 문제에 가장 효과적인 것은 jemalloc 프로파일 러를 사용하는 것입니다.
이 페이지는 많은 도움이되었습니다. https://gdstechnology.blog.gov.uk/2015/12/11/using-jemalloc-to-get-to-the-bottom-of-a-memory-leak/
이 http://stackoverflow.com/questions/36872551/relation-between-memory-host-and-memory-arguments-xms-and-xmx-from-java/보기 36927242 # 36927242 – apangin
기타 흥미로운 링크 https://plumbr.eu/blog/memory-leaks/why-does-my-java-process-consume-more-memory-than-xmx 및 https://blogs.oracle.com/jrockit/entry/why_is_my_jvm_process_larger_t –