Web Application OutOfMemory

From: Iain Downie (iain.downie_at_bto.org)
Date: 03/31/04


Date: Wed, 31 Mar 2004 17:24:02 +0100

Dear List,

we have been getting a number of OutOfMemory errors appearing in our web
applications, particularly when the system is being heavily used. This seems
sensible, but I have a couple of questions that someone will hopefully shed
some light on.

In one of the web applications, I have tried to get some info on memory
usage using Runtime.getRunTime().getTotalMemory() and .getFreeMemory().

I find that the total memory varies between 63MB and 48MB. The free memory
degrades with use, but when I do System.runFinalization() and System.gc(),
it seems to perk up to a respectable level.

I have gone thru the code checking that all statements and ResultSets are
being closed explicitly, but may have missed something, or would this memory
degredation be pretty common from multiple web apps running on the same
server?

Is this total memory the total amount allocated to the JVM, or to each user
that creates a session?

If the first instance, it doesn't seem much and what would seem a more
sensible amount, and if the latter, then I can see that our 1GB of Ram
vanishing quickly as our concurrent users increase.

Also, and possibly related, we have lots of Apache processes that never seem
to vanish. This, and the OutOfMemory seemed to start at around the same
time.

Any ideas?
Iain

PS. System config is: Red Hat Linux 7.2, Oracle App Server 9iAS, OC4J, JDK
1.3.1, 1GB Ram



Relevant Pages

  • Re: xmalloc string functions
    ... require memory allocations depending on the way the system works. ... If the toolkit being used is not one of those, then it is irrelevant that some provide a means to do so, particularly if the "some" are not available for the platform being targeted. ... Not enough context for most real-world applications to recover at this point. ... At this point g_malloccalling abortbecomes a moot point, particularly if your auto-save code is robust against memory allocation errors. ...
    (comp.lang.c)
  • Re: ProDOS Plus
    ... operating system was not considered worth the problems when it was just as easy to make the applications support 128k or more ram. ... your suggested P-code system could do something similar by running in the aux 64k memory range $D000...FFFF or perhaps the aux ram used by the P8 /ram driver code space. ... the OS could fit in *only* the space that ProDOS now occupies. ... if practicality were a concern we probably wouldn't be using old hardware. ...
    (comp.sys.apple2)
  • Re: xmalloc string functions
    ... If these were the only choices (crashing applications or a frozen ... trying to malloc some rediculously large amount of memory - e.g. in the ... because their malloc wrapper decided to exit. ... Exiting on malloc failure makes sense for a utility like sort. ...
    (comp.lang.c)
  • Re: xmalloc string functions
    ... require memory allocations depending on the way the system works. ... Not enough context for most real-world applications to ... It is /more/ reliable to routinely auto-save the user's work (as you ... particularly if your auto-save code is robust against memory allocation ...
    (comp.lang.c)
  • RE: DLLHOST.EXE and Secure Server Crash
    ... This is a very common problem with COM+ components and IIS. ... | Applications view switch to Status View) ... |>with 2-3 dedicated SSL servers. ... A symptom of the problem centers around memory ...
    (microsoft.public.inetserver.iis.security)