MaxPermSize of 512m should be more than enough for the most applications, so you may be right in that the AS might ignore your desired settings.
Simply put, the file run.conf is used only when running the AS under Unix-like systems (by starting the script named run.sh).
On Windows systems run.bat (together with run.conf.bat in later AS versions) can be used for launching the AS.
Additionally, as a rule of thumb you should tamper only with jvm options you are familiar with (e.g., memory-related ones) others can be safely left at defaults. Otherwise they may affect the performance of your application in a negative way.
You can write your additions anywhere near the original lines starting with "set JAVA_OPTS..."
Additionally, you should monitor the memory consumption (by using jvisualvm or a similar tool) of your server in order to be able to set memory levels appropriately.
Hope this helps.
Regarding the PermGenSpace problem:
Do you use hotdeployment? This can be a problem.
How do you start the JBoss, as service?
With JBoss 5.1 you can change the options within the run.conf.bat file.
But as Miklós say 512m is enough PermGen in most cases.
If you still have the problem you should analyze the objects with a heap dump or a java-profiler.
I start the Jboss through service.....
I set the following parameters to the run.bat.conf by hoping AS will pick from here next time
set "JAVA_OPTS=-Xms128M -Xmx512M -XX:MaxPermSize=512M -XX:+CMSClassUnloadingEnabled"
Do i need to restart the Jboss after that?
Secondly when I run the VisualVM from the Jdk\bin it has the status as below.
and also please find below the detail of VisualVM which might help you to fix the issue
1.6.0_23 (Build 100930); platform 100909-1140d3a55456
Windows 2003 (5.2) Service Pack 1, x86 32bit
1.6.0_23; Java HotSpot(TM) Client VM (19.0-b09, mixed mode)
Sun Microsystems Inc., http://java.sun.com/
Cp1252; en_US (visualvm)
C:\Documents and Settings\shamid\Application Data\.visualvm\6u23
Visit https://visualvm.dev.java.net for more information. Built on NetBeans Platform.
Every time you change options in the startup scripts you have to restart the AS in order to apply those changes (since options appearing in these files are passed to the JVM during startup and then get left alone by the server).
You can check the actual (applied) values by opening the file boot.log (in the server/<config>/log folder). The value of VM arguments shows how the AS's boot mechanism sees the options passed to the JVM. If the values of your choice are not appearing there, the settings are certainly misplaced.
Unfortunately, your screenshot can't be displayed by my browser (at least for the moment).
PermGen looks not full because 27MB of 63MB used, you get the picture at the wrong time?
You should monitor the memory with jstat or get a heap history dump, see http://www.oracle.com/technetwork/java/javase/tooldescr-136044.html
Or look ito the troubleshooting guide here : http://www.oracle.com/technetwork/java/javase/memleaks-137499.html
One additional remark: the Max value of 64 megabytes shows that the analysed VM has the maximum size of permanent generation space setting set to 64m. The reasons can be:
- your options are not recognized by the VM (see my previous comment)
- you are not monitoring the VM you really want to monitor: this is more probable, since based on your screenshot you are monitoring the jVisualVM process itself, not a JBoss instance. When running both jVisualVM and a JBoss AS on the same host you should see something like this (if you are monitoring remotely, you have to add the JBoss instance as a Remote Host instead):
yes you right Kasza that in production webserver i am not able to see the java application running on that machine not even the jboss ...
Tell me one thing if i am running the jboss through window service would that be a issue for VisualVM to list it down.
What should i do so that VisualVm start listing the jboss?
Secondly as per discussion i check the boot.log and found below the only related VM argument line
09:43:00,065 INFO [ServerInfo] VM arguments: -Dprogram.name=run.bat -Xrs -Djava.endorsed.dirs=C:\jboss-5.1.0.GA\\lib\endorsed
which is obviously not the one i given in the run.bat.conf.....
Also as i already posted the detail found in the VisualVM and also posting below which might help you finding the issues of VisualVM
why it is saying mixed mode though...
Version: 1.6.0_23 (Build 100930); platform 100909-1140d3a55456
System: Windows 2003 (5.2) Service Pack 1, x86 32bit
Java: 1.6.0_23; Java HotSpot(TM) Client VM (19.0-b09, mixed mode)
Vendor: Sun Microsystems Inc., http://java.sun.com/
Environment: Cp1252; en_US (visualvm)
Userdir: C:\Documents and Settings\shamid\Application Data\.visualvm\6u23
Clusters: C:\Program Files\Java\jdk1.6.0_23\lib\visualvm\platform
I really want to monitor the permgen memory to avoid the future issues related to this so guys your help in this regard will be much appreciated.
There is a known issue that the setting of JAVA_OPTS in service.bat prevents the JAVA_OPTS in run.conf.bat from taking place. To fix this, comment out (or delete) the "if" line in run.conf.bat, like this (new stuff in red):
rem if not "x%JAVA_OPTS%" == "x" goto JAVA_OPTS_SET
And you will also have to change the first line that sets JAVA_OPTS to (new stuff in red):
set "JAVA_OPTS=%JAVA_OPTS% -Xms128M -Xmx512M -XX:MaxPermSize=256M"
Alternatively, you can set all of the JVM options in service.bat, just add them to this existing line: