Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Give more CPU time to GC in java?

I have an java application that uses as much CPU as it can and, with it, a lot of memory (up to 80Gb).

I am optimizing the GC for that app and I want to tell the JVM to use a given percentage of time (60%) to the GC, else the amount of time the machine is not in GC is processing and allocating more memory.

I wanted to confirm that the -XX:CMSIncrementalDutyCycle=60 parameter is the thing I'm looking for and if there is any other parameters to give more power to the GC (I've already seen the CMSIncrementalPacing and CMSIncrementalDutyCycleMin)

Thanks a bunch!

like image 507
mors Avatar asked Oct 22 '22 13:10

mors


1 Answers

You cannot set a ceiling for the CPU usage during the GC collections.

The CMSIncrementalDutyCycle is used to set the time between minor collections (see [1]), so you can control how often the GC runs and thus indirectly the CPU usage. But, there is no parameter that would allow you to control the CPU usage directly.

like image 155
Aleš Avatar answered Oct 24 '22 02:10

Aleš