メモリリークが発生しました。ヒープ解析後の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/ANSWER
の提案の中には、ウェブサイトは、 "ネイティブメモリトラッキング" を伝えるよう(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はオプションではありません。
インターネットを数日間クロールしてさまざまなプロファイラーを試した後、この問題の最も効果的なのは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 –