Tôi đang gặp phải rò rỉ bộ nhớ và ở đây có một số chi tiết.Vùng heap Java và kích thước heap sau khi phân tích đống khác nhau
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
Tôi khá ngạc nhiên khi thấy sự khác biệt giữa kích thước heap-dump và kích thước heap thực tế. Tôi đoán rằng sự khác biệt giữa đầu và heap là khả năng của đống thu rác và vùng heap bản địa. Nhưng, kích thước tệp kết xuất đống và kích thước heap thực tế (từ máy phân tích MAT eclipse) có thể khác nhau như thế nào?
Bất kỳ thông tin chi tiết nào về vấn đề này?
UPDATE/ĐÁP
Một số đề nghị được sử dụng jcmd (https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr007.html) như các trang web nói "Native Memory Theo dõi". Tuy nhiên, nếu bạn đọc kỹ trang, bạn sẽ thấy
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.
Vì vậy, trong trường hợp rò rỉ bên trong thư viện gốc, jcmd không phải là một tùy chọn.
Sau khi thu thập thông tin từ Internets trong nhiều ngày và thử các trình đơn khác nhau, hiệu quả nhất cho vấn đề này là sử dụng jemalloc profiler.
Trang này đã giúp tôi rất nhiều! https://gdstechnology.blog.gov.uk/2015/12/11/using-jemalloc-to-get-to-the-bottom-of-a-memory-leak/
Xem http://stackoverflow.com/questions/36872551/relation-between-memory-host-and-memory-arguments-xms-and-xmx-from-java/ 36927242 # 36927242 – apangin
các liên kết thú vị khác https://plumbr.eu/blog/memory-leaks/why-does-my-java-process-consume-more-memory-than-xmx và https://blogs.oracle.com/jrockit/entry/why_is_my_jvm_process_larger_t –