Generally speaking, GC only works when necessary. Exception, simultaneous sweep of tokens will start prematurely to avoid stopping the application.
IMHO, The simplest / best solution is not to create so much garbage. You can use a memory profiler to reduce the amount of garbage that you produce. This will reduce the size of your collections and how often they occur. In extreme cases, you can avoid collecting during the day or even a whole week.
The advantage of reducing garbage is that you reduce the cleaning of processor caches from garbage. Your L3 cache is just a few MB, and you are creating a few MB of garbage that will effectively crowd out useful information, slowing down your application.
Peter Lawrey
source share