0

I have an application which loads some data from XML.I have given 3GB of Xmx for this with G1GC as garbage collector set.
This works fine but for smaller footprint instances (where data is quite less ~100 MB), memory size still shows ~500MB even after invoking GC.

See attached image:
1. Application started, Size = ~2.75 GB, Used = ~1.5 GB
2. I pressed GC couple of times, Size and Used gets drooped but even now, Size is about 3.3 times of Used. (This 3.3 time holds true for bigger data also).
JVisualVM

My question is there any way to reduce the gap between Size and Used memory so that unused memory can be released to OS.

Tim Diekmann
  • 7,755
  • 11
  • 41
  • 69
NumeroUno
  • 1,100
  • 2
  • 14
  • 34
  • Note: the actual memory resident is what you should be looking at and this could be quite a bit higher than what is used by the heap. – Peter Lawrey Aug 07 '18 at 12:01
  • Hi, It worked out after setting -XX:MaxHeapFreeRatio=20 (some lower value) with GC as g1gc. – NumeroUno Aug 09 '18 at 08:48

0 Answers0