| Iain Downie 2004-03-31, 12:44 pm |
| 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
|