0

I have a simple application which is basically reading from two database sources and doing the comparison in a batch of 1000 rows. I saw that heap memory of the application started reducing after the certain time. Currently, the total no. of rows are less and I am able to complete it before it runs out of memory.

But I am curious to know why this is happening? Any ideas?

JVM Info:
JVM: OpenJDK 64-Bit Server VM (25.242-b08, mixed mode).
Java: version 1.8.0_242, vendor AdoptOpenJDK.
Java Home: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre.
JVM Flags: .

enter image description here

Madhur Ahuja
  • 22,211
  • 14
  • 71
  • 124
  • It looks like the JVM realizes that not all that much memory is required as it initially allocated. – Joachim Sauer Jun 26 '20 at 20:12
  • That's the standard behaviour, see, for example, this [question](https://stackoverflow.com/questions/2617159/java-heap-keeps-on-shrinking-what-is-happening-in-this-graph-of-heap-size) for more info (or [this](https://stackoverflow.com/questions/12150668/why-isnt-the-allocated-heap-memory-shrinking-when-usage-is-below-maxheapfreerat)). – WoAiNii Jun 26 '20 at 20:30

0 Answers0