I have a complex large multithreaded application to which I am introducing new functionality.
I have added a call to a piece of specialist hardware (via a vendor supplied JNI lib). However before that (very fast) function is called some work is done beforehand to populate the data structure sent to it.
However the GC profile of the application is very choppy/bad and it seems that some of these population steps are being interrupted by GC. This matters because time needs to be kept constant or as constant as possible between the first of these events and the hand off to the hardware resource.
Is there a way to say, "sychronise for GC", these operations so that they won't be held up during stop the world GC pauses?
Using a 64bit 1.7 JDK on RHL5.5
Thanks
If it is in-fact during the full garbage collection you are experiencing the issues, then the question is what can you do to bring down the frequency of these full garbage collection sweeps.
First, try and analyse what circumstances triggers these full sweeps, are you running low on heap space in general? And if so, why are you frequently running low on heap (are there a potential leak somewhere?)
Also, during minor (the faster) garbage collections, objects are moved from the young generations (eden and survivor 1) to survivor 2. If it doesn't fit in survivor 2, they will be moved to tenured, if there isn't enough space in tenured, you trigger a full sweep. So, if your young generations are large, and you have a certain amount of long running objects, this might cause issues.
In the end of the day, you have to analyse it. Profile you application, and determine when and why you are seeing full garbage collections, and then tune your application to make them less frequent or potentially ensure that the are so infrequent you can "control" when they happen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With