First two easy way to free up some resources on a vps running java are: stopping java process and second, not even try to use java in a openvz VPS :)

If you are forced to use java you can lower it’s memory usage by adding following option to java startup: -Xmx32m so you lower maximum heap size .

You can try different values of heap size regarding of you java applications usage.

On Plesk panel you can set this in : /usr/share/tomcat5/bin/setenv.sh

On cPanel you can set it on : /usr/sbin/starttomcat like bellow:

#########################
system(
qw(
./jsvc
-user tomcat
-Xms64m
-Xmx64m
-cp ./bootstrap.jar
-Djava.endorsed.dirs=../common/endorsed
-outfile ../logs/catalina.out
-errfile ../logs/catalina.err
-verbose
)
###################################
or set additional java options by creating file : /var/cpanel/tomcat.options (may not work for some options).