Shahbour
Shahbour

Reputation: 1323

spring boot garbage collection

I am trying to limit the the maximum memory given to a spring-boot application and would like to check the garbage collection to see if what i have set is good or no .

I am using spring-actuator which do expose 4 properties

Sample 1

"gc.ps_scavenge.count": 84,
"gc.ps_scavenge.time": 1150,
"gc.ps_marksweep.count": 3,
"gc.ps_marksweep.time": 392 

Sample 2

"gc.ps_scavenge.count": 804592,
"gc.ps_scavenge.time": 5361101,
"gc.ps_marksweep.count": 15923,
"gc.ps_marksweep.time": 2949279,

I could not find any guidelines on what to check and what is considered a good value also what exactly is the time value , is it accumulative or average ?

May be my question is well known but I have not experience is garbage collection monitoring and could not find answers.

Upvotes: 2

Views: 7837

Answers (1)

James
James

Reputation: 300

By default, spring boot actuator prints the time and count of all beans that implement the GarbageCollectorMXBean. The docs say that the time is "the approximate accumulated collection elapsed time in milliseconds".

What is a good value is dependent on your documentation, but from what I've read it is the portion of time spent collecting garbage that you should be concerned about. You should use the uptime metric to calculate the percentage of time.

Upvotes: 2

Related Questions