views:

100

answers:

3

Hi, all.

One of my applications runs on a Windows Service instance of Tomcat 5.5, running Java 1.6. We've got an issue in the code where the application creates a NullPointerException if a SOAP request times out.

We had an issue, this morning, where the component on the other side of the SOAP request was unavailable. The result was about ten thousand NullPointerExceptions. After we got the failed component running again, the exceptions stopped. However, we noticed that our application was still performing sluggishly.

After restarting the Tomcat service, application performance immediately improved. I find that this is merely a handy coincidence, but my teammates are skeptical.

Is it possible that all of those NPEs caused performance issues within Tomcat, but long after the exceptions had stopped?

Thanks!
IVR Avenger

+2  A: 

There are a number of possible problems:

  • The exceptions caused a memory leak.
  • The exceptions caused an infinite loop in some threads.
  • Reloading the application caused a memory leak.
  • HotSpot had optimised for the case of failing exceptions (should sort itself out again quite quickly).
Tom Hawtin - tackline
A: 

I don't think NPE would cause any issues specifically but Exception can cause problems if not handled properly.

For example, we had a similar issue when we had lots of exceptions. We had a global session objects which contains all user sessions. We normally clean it up when request is finished. However, we didn't do a finally block so it was not cleaned in case of an exception. That causes memory leak and slowed the server down.

Tomcat is generally getting faster after restart so it may be normal depending on how much improvement you get.

ZZ Coder
A: 

Tomcat logs all activity In your case "Ten thousand NullPointerExceptions" One way to track the performance is try catching that excption and ignore. Obviously this not the solution but you can try what happens.

Madhu