C# dev here, forced to deal with Java... I am interfacing to a Java Web Service, which is quite memory and CPU heavy. It .
Facts:
Every now and then, the web service is hit by Garbage Collection storms and it slows down processing (as determined by the vendor of the Java Web Service).
My question, not knowing much about Java GC, is why does GC even kick in if there is plenty of RAM available. Is there some setting which tells it to kick when there is little memory left?
My frame of reference is the .NET GC, which only kicks in when there is memory pressure.
There are several garbage collection models available in Java. You can experiment to see which one has the least impact in your particular use case. See:
I was able to get much smoother / predictable performance in a web service a while back by selecting an appropriate collection model.