<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d11356004\x26blogName\x3dxception\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://openrent.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://openrent.blogspot.com/\x26vt\x3d-2179510228592399674', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Test JVM arguments

If you want to change the behavior of your JVM, you can pass it several parameters at start time. Unfortunately, you cannot pass attributes to a running JVM, and must usually set them in a config file. The JVM then reads this configuration file at start time, and initializes the JVM with the correct parameters.

This works well, except when you make a syntax error in the parameters, or string together parameters that the JVM does not support. To avoid the potential embarassment when your server fails to start with the new JVM parameters, test the new settings first. Here's how:

1) Find the Java interpreter used by the Java container. Usually, this is listed in a configuration file that points to a JRE or JDK. Note that the system JDK or JRE software will usually be located in /usr/java/

2) Create a test Java file called Hello.java that simply prints a "Hello, world!" message to the screen. Here is the code for the file:
class Hello {
public static void main(String[] args)
{
System.out.println("Hello, world!");
}
}

3) Compile the Hello.java file using the same JDK the Java container uses.
(ex: /usr/java/jdk1.4_01/jdk/bin/javac Hello.java)

4) Execute the Hello.class file with the JVM arguments you want to test. For example:
/usr/java/jdk1.4_01/jdk/jre/bin/java verbose:gc -Xmx512M -Xms128M -XX:MaxPermSize=128M -XX:NewRatio=2 -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC Xloggc:gc.log -XX:+UseTLAB -XX:+UseParallelGC Hello

5) You should see the "Hello, world!" code return without error.