Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
217 views
in Technique[技术] by (71.8m points)

java - Huge memory consumption until explicitly ask for "Permfom GC" from jconsole

I am working on a JAVA (springboot) microservice that runs as a daemon. the process had been started for days when I wanted to monitor it via jconsole.

Jconsole reported me a huge memory consumption (around 1.3G): my process was not supposed to consume so much memory

More strange, I asked jconsole to "Permfom GC" (button on the right-top corner of the "Memory" tab) and my memory consumption immediately reduced to around 100M !!!

it is as if the garbage collector did not work until then, or as if it only partially worked until then

In the "VM Summary tab", I can also read this:

  • Uptime:?7 days 5 hours 24 minutes
  • Garbage collector:? Name = 'PS MarkSweep', Collections = 4, Total time spent = 0.857 seconds
  • Garbage collector:? Name = 'PS Scavenge', Collections = 24, Total time spent = 1.220 seconds

Does that mean that I garbage collector only very rarely launches (4 + 24 times in 7 days)?

Can anyone help me to understand this behavior? Thank you

For additional information, here are the arguments I given to my JVM:

-XX:+HeapDumpOnOutOfMemoryError
-Dfinastra.log=/my/application/directory/application.yaml
-XX:ErrorFile=/my/application/directory/error.log
-XX:HeapDumpPath=/my/application/directory/heap_dump.hprof
-Dssh.server.keystore=/my/application/directory/hostkey.ser
-Dgosh.args=--nointeractive 
question from:https://stackoverflow.com/questions/66065101/huge-memory-consumption-until-explicitly-ask-for-permfom-gc-from-jconsole

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...