1

I got a requested causing OutOfMemory exception, this caused Tomcat to stop responding, is there a way to gracefully kill such a request and have Tomcat continue serving other requests?

Using Tomcat7.

Dudi
  • 2,340
  • 1
  • 24
  • 39
  • This is pretty vague. Was it your application code that encountered the out of memory error? Or was it some internal Tomcat function? Could you edit your question to add the stack trace for the out of memory error, and some of the code for any of your functions that appear in the stacktrace? – Kenster Mar 01 '15 at 15:23
  • take a look : http://stackoverflow.com/questions/3058198/can-the-jvm-recover-from-an-outofmemoryerror-without-a-restart – Nimrod007 Mar 01 '15 at 15:23
  • The trouble is that the thread that receives the OutOfMemoryError is not necessarily the one responsible for consuming all the memory, and aborting that particular request isn't guaranteed to solve the underlying problem. – Ian Roberts Mar 02 '15 at 10:40

1 Answers1

0

No. OOME is a JVM wide issue that can't be constrained to a single request. You need to fix the root cause of the OOME error rather than trying to limit its effects.

Mark Thomas
  • 16,339
  • 1
  • 39
  • 60