2

I have some frequent full GC problems in production with Java, I suspect the memory was allocated by network library for buffering TCP request result.

I have dump the Java heap when the memory usage is high (about 8GB). I tried to analyze the .HPROF file with eclipse MAT, the file is about 8GB.

But in eclipse MAT, the total heap size is about 200 MB, so I could not find which objects are taking up to 8GB heap memory.

Since eclipse MAT is not showing the full heap dump content, I don't know how to find why the application is taking so much memory.

Jay
  • 601
  • 6
  • 17
  • Do you have GC logs? – Erik Dec 15 '20 at 15:10
  • 1
    Not all of the process memory is allocated to the heap – Erik Dec 15 '20 at 15:10
  • I suspect Netty is allocating off-heap memory, I have found huge blank byte[] arrays in memory dump – Jay Dec 16 '20 at 02:34
  • There is error in thrift decoding, thrift client is creating a near 2g byte array for buffering – Jay Dec 16 '20 at 03:58
  • 1
    Did you try other heap dump analyzing tools? – Holger Dec 16 '20 at 10:59
  • I have tried jxray, jxray can find huge blank byte[] in memory dump – Jay Dec 18 '20 at 01:47
  • I think the question is resolved. Now I need to stop thrift protocol parser to create huge blank buffer, this is another topic. – Jay Dec 18 '20 at 01:51
  • 1
    Does this answer your question? [eclipse memory analyzer sees small part (363,2MB) of entire heap dump (8GB)](https://stackoverflow.com/questions/17085538/eclipse-memory-analyzer-sees-small-part-363-2mb-of-entire-heap-dump-8gb) – Didier L Sep 06 '22 at 09:58

1 Answers1

2

If you are using MAT memory analyzer to open the hprof dump, it may be that the rest of the heap are unreachable objects, which MAT hides by default, see https://stackoverflow.com/a/20405267/3484881

tporeba
  • 867
  • 10
  • 23