So I have a RESTful application with an enormous quantity of short-lived complex objects in memory. When the GC decides to run it does so for a couple hundreds of milliseconds. Does it mean that if a client tries to make a HTTP Request while my JVM is GCing, the client will receive an error?
So I have a RESTful application with an enormous quantity of short-lived complex objects
Share
No the client won’t receive an error.
If it only takes a few hundred milliseconds the rest call is not going to time out.
Additionally unless there is something concerning with the application server you are running the services on the JVM should be able to respond to the service call.
If the application server is CPU bound and struggling to respond to all of the requests already the extra latency could result in timeouts, however that is more indicative of a poorly performing application server than of garbage collection itself.