How to setup the heap size using WAS
This is about heap sizes and JVM arguments while setting up with WAS. I have 16GB memory and 64 bit windows OS. So the initial settings could be as below. And
the initial and maximum heap size set to 4096
-Xmx4g -Xms4g -Xmn512m
-Xgcpolicy:gencon -Xcompressedrefs
-Xgc:preferredHeapBase=0x100000000
The above configuration/settings works fine with me.
In case I need more heap size then:--
Tip: If you need more heap size,
then you can use the following setting, replacing {N} with the amount of memory
to be used and {N/8} with 1/8 of the total memory. For example, if -Xmx is set
to 8g, -Xmn should be set to 1g.
-Xgcpolicy:gencon -Xmx{N} -Xms{N} -Xmn{N/8}
-Xcompressedrefs -Xgc:preferredHeapBase=0x100000000
If the above statement is true then following is my configuration.
-Xmx8g -Xms4g –Xmn 1g
-Xgcpolicy:gencon -Xmx{N} -Xms{N} -Xmn{N/8}
-Xcompressedrefs -Xgc:preferredHeapBase=0x100000000
And of course the initial and maximum heap size set to 8192
After I have done above settings, the WAS console does not start. Is there anything wrong while increasing the heap size to 8g.?? where is log file and what could be the name of the log file i should read
2 answers
The logs should be in the logs directory under the WAS profile
...\WebSphere\AppServer\profiles\AppSrv01\logs\server1 is where they are on my system
I suggest stopping the server, deleting the existing logs, restarting the server and looking through any of the new logs with data.
I have also seen issues with the -Xgc:preferredHeapBase=0x100000000 setting
That requires the memory to be contiguous which seems to be a frequent problem. Although with 16 gigs of RAM that becomes much less likely. Still might be worth testing without it.
Update:
I have not set up WAS with 8 gigs of memory at least in a while.
I usually go much lower because I am on my personal system and only use it for testing.
I have seen a number of customers set up that way so it should work.
In case there is a problem the settings are contained in the server.xml file.
If you create a backup copy of that before making changes it should be easy enough to revert back to the old settings instead of having to recreate the profile.
It will be located here:
\WebSphere\AppServer\profiles\AppSrv01\config\cells\<servername>Node04Cell\nodes\<servername>Node04\servers\server1\server.xml
where <servername> = the name of my computer
The jvm settings are under the jvmEntries tag in that file as follows:
(Note the heap sizes are in MB)
initialHeapSize="4096"
maximumHeapSize="4096"
-Xgc:preferredHeapBase=0x100000000"
To set the values from the admin console
Log into WebSphere select server->server types -> WebSphere application servers
Choose server1 from the list
On the right column expand "Java and Process Management"
Select "Process Definition"
Under additional properties select "Java Virtual Machine"
Set Initial heap size and Maximum heap size to your desired values (in MB)
the -Xgc:preferredHeapBase setting will be on the same page under Generic JVM arguments if it is set.
...\WebSphere\AppServer\profiles\AppSrv01\logs\server1 is where they are on my system
I suggest stopping the server, deleting the existing logs, restarting the server and looking through any of the new logs with data.
I have also seen issues with the -Xgc:preferredHeapBase=0x100000000 setting
That requires the memory to be contiguous which seems to be a frequent problem. Although with 16 gigs of RAM that becomes much less likely. Still might be worth testing without it.
Update:
I have not set up WAS with 8 gigs of memory at least in a while.
I usually go much lower because I am on my personal system and only use it for testing.
I have seen a number of customers set up that way so it should work.
In case there is a problem the settings are contained in the server.xml file.
If you create a backup copy of that before making changes it should be easy enough to revert back to the old settings instead of having to recreate the profile.
It will be located here:
\WebSphere\AppServer\profiles\AppSrv01\config\cells\<servername>Node04Cell\nodes\<servername>Node04\servers\server1\server.xml
where <servername> = the name of my computer
The jvm settings are under the jvmEntries tag in that file as follows:
(Note the heap sizes are in MB)
initialHeapSize="4096"
maximumHeapSize="4096"
-Xgc:preferredHeapBase=0x100000000"
To set the values from the admin console
Log into WebSphere select server->server types -> WebSphere application servers
Choose server1 from the list
On the right column expand "Java and Process Management"
Select "Process Definition"
Under additional properties select "Java Virtual Machine"
Set Initial heap size and Maximum heap size to your desired values (in MB)
the -Xgc:preferredHeapBase setting will be on the same page under Generic JVM arguments if it is set.
Comments
Hi Karl,
I would like to know whether you have increased the heap size from 4g to 8G, if yes how?
Is there any issue. I dont mind to change now, but i am little scared in case WAS does not start after i change the settings.
Hi Manoj See my update to my answer above (it was a little long for a comment)