Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java.lang.OutOfMemoryError - server going down

Reply
Thread Tools

java.lang.OutOfMemoryError - server going down

 
 
Simon
Guest
Posts: n/a
 
      04-22-2005
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
 
Reply With Quote
 
 
 
 
Michael Berg
Guest
Posts: n/a
 
      04-22-2005
> 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


 
Reply With Quote
 
 
 
 
Daniel Dyer
Guest
Posts: n/a
 
      04-22-2005
On Fri, 22 Apr 2005 22:39:10 +0100, Michael Berg >
<<(E-Mail Removed)> wrote:

> 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.


--
Daniel Dyer
http://www.footballpredictions.net
 
Reply With Quote
 
Marcus
Guest
Posts: n/a
 
      04-23-2005
Daniel Dyer wrote:

> On Fri, 22 Apr 2005 22:39:10 +0100, Michael Berg >
> <<(E-Mail Removed)> wrote:
>
>> 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.
>
>

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
 
Reply With Quote
 
Tony Morris
Guest
Posts: n/a
 
      04-23-2005

"Simon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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/


 
Reply With Quote
 
Michael Berg
Guest
Posts: n/a
 
      04-23-2005
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OT: Windows XP: Going, going ... gone? OTHMAN MCSE 2 03-25-2008 04:45 PM
XP search going all lame on me..explorer going crazy when trying tosearch. fotoobscura Computer Support 8 01-12-2008 01:09 AM
Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up." Midex Python 24 05-07-2007 04:23 AM
floppy drive just keeps on going and going and ... Weylon Bulloch Computer Support 1 09-07-2003 07:17 AM
VPN going up but traffic going one way PLP Cisco 1 07-11-2003 08:28 AM



Advertisments