View Full Version : Memory Heap
9424419352
27-03-2010, 10:04
http://java-monitor.com/postedimages/5ec274e8-2ee2-4335-a753-72d6ee9c7fb9.png
The graph says that Memory Heap in used is almost 95%. How to free memory
kjkoster
27-03-2010, 11:48
Dear 9424419352,
You are running with a 64MB heap, which is really small. I would suggest you raise the heap size to 256MB to see if that helps. Use the -Xmx flag for that.
To free memory, you can use a memory profiler and see what the memory is being used for. Then change the code not to use so much memory.
Kees Jan
9424419352
01-04-2010, 06:37
Dear Kee Jan
As you suggested that I need to increase memory heap to 256 MB. And also u menstioned the flag also. But this not clear to me , in Apache Tomcat server, where I need to mention that. Hope your solution may give me best performance of my web server
Thanks
Dhruba
kjkoster
01-04-2010, 09:23
Dear Dhruba,
Setting this configuration is different for each operating system. Tomcat listens to an environment variable named JAVA_OPTS for things like this. On UNIX-like systems, you can edit the startup script to have do something like this at the beginning:
JAVA_OPTS="${JAVA_OPTS} -Xmx256m"
export JAVA_OPTS
On other systems I don't know how to set that flag, but I am sure that is you Google for "tomcat JAVA_OPTS xmx" you will find more about that.
Please note that you need to restart Tomcat afterwards.
Kees Jan
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.