java.lang.OutOfMemoryError - server going down

Discussion in 'Java' started by Simon, Apr 22, 2005.

  1. Simon

    Simon Guest

    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
     
    Simon, Apr 22, 2005
    #1
    1. Advertising

  2. Simon

    Michael Berg Guest

    > 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
     
    Michael Berg, Apr 22, 2005
    #2
    1. Advertising

  3. Simon

    Daniel Dyer Guest

    On Fri, 22 Apr 2005 22:39:10 +0100, Michael Berg >
    <<> 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
     
    Daniel Dyer, Apr 22, 2005
    #3
  4. Simon

    Marcus Guest

    Daniel Dyer wrote:

    > On Fri, 22 Apr 2005 22:39:10 +0100, Michael Berg >
    > <<> 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
     
    Marcus, Apr 23, 2005
    #4
  5. Simon

    Tony Morris Guest

    "Simon" <> wrote in message
    news:...
    > 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/
     
    Tony Morris, Apr 23, 2005
    #5
  6. Simon

    Michael Berg Guest

    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
     
    Michael Berg, Apr 23, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ian Suttle
    Replies:
    2
    Views:
    2,378
    Wolfram Rittmeyer
    Aug 27, 2003
  2. Xiaopeng Xiong

    java.lang.OutOfMemoryError problem

    Xiaopeng Xiong, Nov 14, 2003, in forum: Java
    Replies:
    3
    Views:
    457
    Xiaopeng Xiong
    Nov 15, 2003
  3. Mit Majithia
    Replies:
    6
    Views:
    15,353
    Moazam Raja
    Feb 26, 2004
  4. H.MuthuKumaraRajan

    java.lang.OutOfMemoryError

    H.MuthuKumaraRajan, Apr 3, 2004, in forum: Java
    Replies:
    1
    Views:
    1,244
    e.Morr
    Apr 3, 2004
  5. Goofball
    Replies:
    9
    Views:
    820
    Goofball
    Nov 8, 2006
Loading...

Share This Page