Howto limit java application memory specially on a VPS
Posted by HostsVault | Posted in How-To's | Posted on 13-05-2009-05-2008
1
Many Java application users may face this problem that their java virtual machine JVM is eating alot of memory , infact Java is greedy when allocting memory it will try allocating all the memory it can so and wil share it with other instances but this is a problem specially when your on a VPS and have limited memory .
You can limit the amount of memory Java application uses by using this command when compiling your application :
/usr/local/jdk/bin/javac -J-Xmx”amount of ram” application.java
so for example to allocate 128 MB RAM only you run
/usr/local/jdk/bin/javac -J-Xmx128 application.java
You can limit the amount of m This way your application wouldn’t allocate more than 128 MB RAM.


BigMIke…
I am So Lucky That I found your blog and great articles. I will come to your blog often for finding new great articles from your blog.I am adding your rss feed in my reader Thank you…