java.lang.OutOfMemoryError - server going down

S

Simon

Hi,

I've got a web application, which is using the Orion 2.02 application
server. We've added another system to the suite of systems we already
have in the last 3 months.

Since then, we're having problems with the server and it keeps going
down and on the log file we're getting a load of exceptions and below
is the error message we got.

We've already moved the system to a more powerful server. We've gone
through everything and we have no definite answers. Is it hardware??
code(i.e.code leak)???

Of course I know its running out of memory, but what else is causing
it or has anyone experienced similar problems.

Can anyone help and explain what is going wrong???

[http-server] Exception calling scheduled listener:
java.lang.NullPointerException
<c18;client18>: caught exception [java.lang.OutOfMemoryError] null
<c27;client27>: caught exception [java.lang.OutOfMemoryError] null
<c30;client30>: caught exception [java.lang.OutOfMemoryError] null
<c7;client7>: caught exception [java.lang.OutOfMemoryError] null
<c1;client1>: caught exception [java.lang.OutOfMemoryError] null
<c43;client43>: caught exception [java.lang.OutOfMemoryError] null
[http-server] Exception calling scheduled listener:
java.lang.NullPointerException
<c10;client10>: caught exception [java.lang.OutOfMemoryError] null

Regards
Simon
 
M

Michael Berg

I've got a web application, which is using the Orion 2.02 application
server. We've added another system to the suite of systems we already
have in the last 3 months.

I don't know the Orion app server but clearly it is not launching the java
vm with a sufficient heap size. I think the default heap size is a meager
32M, which is enough for most trivial projects but far short for any serious
work.

I suggest you check whatever runtime environment options your app server
offers, and increase the heap size according to your project needs.

Note that if you are using some third party packages, these packages may
contain code that causes the host jvm to leak memory. I have had this
situation happen to me with the MySQL jdbc driver as well as with an older
version of Lucene. It might be worth checking up on external packages to see
if newer versions are available.

Incidently the out of memory message is notorious for *not* telling us where
the exception occurred. Debugging those exceptions can be a real pain,
especially if your project is multithreaded, runs inside a host environment
you don't fully control and leverages several packages for which you don't
have the source code, or are simply too complicated to dive into. In other
words, almost every serious enterprise project :)

Good luck.

/Michael
www.hyperpal.com
www.bergconsult.com
 
D

Daniel Dyer

Incidently the out of memory message is notorious for *not* telling us
where
the exception occurred. Debugging those exceptions can be a real pain,
especially if your project is multithreaded, runs inside a host
environment
you don't fully control and leverages several packages for which you
don't
have the source code, or are simply too complicated to dive into. In
other
words, almost every serious enterprise project :)

Even if it did tell you where the error occurred, that information is
almost useless. It will just indicate the straw that broke the camel's
back. If you have 1mb of available memory and your badly behaved method
consumes 0.99mb before another well behaved method comes along and tries
to get 20kb on another thread, that second, well behaved method will cause
an OutOfMemoryError even though it's the other method that is the root of
the problem. A stack trace is meaningless in this situation.

Dan.
 
M

Marcus

Daniel said:
Even if it did tell you where the error occurred, that information is
almost useless. It will just indicate the straw that broke the
camel's back. If you have 1mb of available memory and your badly
behaved method consumes 0.99mb before another well behaved method
comes along and tries to get 20kb on another thread, that second,
well behaved method will cause an OutOfMemoryError even though it's
the other method that is the root of the problem. A stack trace is
meaningless in this situation.

Dan.
Exactly. Check your server startup scripts. They may not be allocating
more then the default maximum heap size. The option for adjusting the
maximum heap size on the java command is -Xmx <amount>, eg. -Xmx 512M.

Of course, it may be that your new application is behaving badly. You
should run a profiler against it, which will be able to tell you where
the memory is being used (among other things). There are several around,
I've used JProfiler the most, which i quite like, but it's not free.

Good luck
 
T

Tony Morris

Simon said:
Hi,

I've got a web application, which is using the Orion 2.02 application
server. We've added another system to the suite of systems we already
have in the last 3 months.

Since then, we're having problems with the server and it keeps going
down and on the log file we're getting a load of exceptions and below
is the error message we got.

We've already moved the system to a more powerful server. We've gone
through everything and we have no definite answers. Is it hardware??
code(i.e.code leak)???

Of course I know its running out of memory, but what else is causing
it or has anyone experienced similar problems.

Can anyone help and explain what is going wrong???

[http-server] Exception calling scheduled listener:
java.lang.NullPointerException
<c18;client18>: caught exception [java.lang.OutOfMemoryError] null
<c27;client27>: caught exception [java.lang.OutOfMemoryError] null
<c30;client30>: caught exception [java.lang.OutOfMemoryError] null
<c7;client7>: caught exception [java.lang.OutOfMemoryError] null
<c1;client1>: caught exception [java.lang.OutOfMemoryError] null
<c43;client43>: caught exception [java.lang.OutOfMemoryError] null
[http-server] Exception calling scheduled listener:
java.lang.NullPointerException
<c10;client10>: caught exception [java.lang.OutOfMemoryError] null

Regards
Simon

Run the application server under a profiler.
Watch it crash and burn for a reason.
My money is on a leaking application.

--
Tony Morris

JTiger Unit Test Framework for J2SE 1.5
http://www.jtiger.org/
Java Q&A (FAQ, Trivia)
http://qa.jtiger.org/
http://xdweb.net/~dibblego/
 
M

Michael Berg

Hello,
Even if it did tell you where the error occurred, that information is
almost useless. It will just indicate the straw that broke the camel's
back.

There is some truth in that but in my experience, understanding where an
exception occurs is useful in ruling out code for debugging. In other words,
if you know how far your program got before the exception occurred, you also
know what you don't have to worry about. This certainly is useful.

/Michael
www.hyperpal.com
www.bergconsult.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top