4 ms·
Does the JVM finish up outstanding requests and ask the load balancer to please-don't-send-me-anything-for-a-bit before it does a full GC?
by jbri 15y ago
Does the JVM finish up outstanding requests and ask the load balancer to please-don't-send-me-anything-for-a-bit before it does a full GC?
- nl 15y agoNo. I suppose in theory you could use JMX instrumentation and tie it to your load balancer, but I've never heard of it being done. (It's actually quite a good idea! hmm...)
- wolf550e 15y agoIf you trigger a full GC "from outside", the way you would trigger a restart, you'd perform whatever you do for a restart (stop accepting requests, finish accepted requests, be unavailable, start accepting requests). My point was that a full GC does not need to re-profile the code, re-JIT the code and warm data caches, like a newly restarted JVM does. Sending a user request to a JVM to be run in an interpreter with cold caches is not good for user satisfaction, so a newly restarted JVM needs to be given mock requests to warm it up (like a script for PGO static compilation). A JVM doing a full GC does not need all that to become fully ready, and if it has enough free RAM to defragment quickly, the process should be much more efficient.