What tools or best practices are available for gracefully degrading service in a Java service during bursts of memory-intensive requests? The application in question is multi-threaded. The amount of work required to handle each request can vary greatly and would not be easy to split up and parallelize.
I’m wary of writing application level code that concerns itself with heap usage and GC but we find the application can get itself in to trouble, meaning out of memory errors or full GC, by taking on more than one intensive request. Often a full GC is not able to find any memory to free.
Long story short: I am thinking of adding some throttling or queuing capabilities to pre-empt this kind of problem.
Any ideas or advice appreciated.