I want to use the latest G1 garbage collector however I am running into a situation where I hit memory allocation errors when using it. I believe this is because it is releasing memory back to the OS, and the OS is then not allowing the JVM to have it back when it requested since this does not happen with the CMS collector. The particular server I am running on has been functioning fine with the CMS collector (besides some less than ideal GC pauses), as soon as I move it to G1 it hits these allocation errors after about 6 hours of running and the JVM exists.
It is not clear if it is possible to prevent this from happening with the G1 collector but I was hoping someone in the community would have an answer.
Thanks!