Hi,
I have a JSP/Servlet application using a session attribute and JDBC to update and query the database (Oracle) using Orion web server. In other words, it's very memory intensive. For one part of the application, I insert, update, do 3 queries on one servlet and pass the data as a Javabean to a JSP. Once in a while, I've been getting an "OutOfMemory" message. However upon review of the classes using the HAT log, my classes are garbage collected. I have increased the maximum memory allocation to 80m and it's working fine for now. My question is since this application will be used by 2000 people, should I increase the memory using Xmx? If yes, what is the max memory? Thanks.
-
Memory Issues (3 messages)
- Posted by: Mike Chang
- Posted on: June 26 2002 01:36 EDT
Threaded Messages (3)
- Memory Issues by Jim Hall on June 27 2002 11:29 EDT
- Memory Issues by Leonard Gurevich on June 27 2002 16:36 EDT
- Memory Issues by Steff Y.Z on June 29 2002 10:12 EDT
- Memory Issues by Leonard Gurevich on June 27 2002 16:36 EDT
-
Memory Issues[ Go to top ]
- Posted by: Jim Hall
- Posted on: June 27 2002 11:29 EDT
- in response to Mike Chang
Initially, your memory must have been so low that garbage collection could not reclaim enough of it for your application to continue running. This might have occured due to a single thread requiring more memory than your maximum. I've found that 256m is a decent max setting for a memory-intensive app (that is, if your server has enough memory to allow that). These are the memory options I use:
-XX:NewSize=128m -XX:MaxNewSize=128m -XX:SurvivorRatio=4 -XX:MaxHeapFreeRatio=80 -XX:MinHeapFreeRatio=20 -ms256m -mx256m
Those XX options are for GC tuning and do not work in older JVMs (pre-1.3?).
Let's say that each thread eats up 20m per request. That's really a lot, but even still it is much less than 256. You shouldn't get an exception for being out of memory. Your GC will be running constantly though, but it should scale up to a degree. You'll find that GC has become your bottleneck. Use -verbose:gc to see when GC kicks in. -
Memory Issues[ Go to top ]
- Posted by: Leonard Gurevich
- Posted on: June 27 2002 16:36 EDT
- in response to Jim Hall
Where can I find all docs for -XX options.
Thanks. -
Memory Issues[ Go to top ]
- Posted by: Steff Y.Z
- Posted on: June 29 2002 22:12 EDT
- in response to Leonard Gurevich
java options