1

I read in this excellent answer that the HotSpot JVM does release memory back to the OS, but does so reluctantly.

What does "reluctantly" mean in this context? That is, other than setting:

  • -XX:GCTimeRatio=19
  • -XX:MinHeapFreeRatio=20
  • -XX:MaxHeapFreeRatio=30
  • -XX:InitiatingHeapOccupancyPercent=10

to make GC "more aggressive", how does GC actually decide when to release back to the OS instead of keeping it for reuse by the same process?

ih8ie8
  • 944
  • 8
  • 23
  • I don't see anything here that isn't answered in the duplicate. – user207421 Jun 16 '20 at 12:56
  • 1
    It depends on the GC, mainly. It's heuristics tell when to give memory back. – Eugene Jun 17 '20 at 02:22
  • @MarquisofLorne The duplicate, which is already mentioned in my question, gives excellent tips to control aspects for "release back to OS". But I am more interested in **what triggers** such a release. Googling this only yields settings and more settings... https://www.google.com/search?client=firefox-b-d&q=%5Bjava%5D++what+triggers+gc+release+back+to+OS – ih8ie8 Jun 17 '20 at 16:52

0 Answers0