Optimal settings for JAVA_OPTS on a 4 gig Windows 7 computer?

Does anyone have suggestions for the optimal settings for JAVA_OPTS on a 4 gig Windows 7 64 bit OS?

My computer hangs every time I try to run the DATAMART process.

Current settings are: SET JAVA_OPTS=-Xmx6000m -Xms3000m -XX:MaxPermSize=500m -XX:PermSize=300m

Randy Wilson

Hi Randy,

This is proobably not the solution, but just yesterday I had a problem
on a laptop with Windows 8 where it appeared as if the JVM took no
notice of my JAVA_OPTS, the reason for which I still fail to
comprehend.

So just to make sure, you could try and feed the parameters directly
to the Java process as you are starting DHIS2, if you're using DHIS
Live you could try something like this from a Command prompt:

java -Xmx6000m -Xms3000m -XX:MaxPermSize=500m -XX:PermSize=300m -jar
dhis-live.jar

For Tomcat you could also put it in one of the startup scripts, I guess.

Knut

···

On Fri, Feb 22, 2013 at 4:53 PM, Wilson,Randy <rwilson@msh.org> wrote:

Does anyone have suggestions for the optimal settings for JAVA_OPTS on a 4
gig Windows 7 64 bit OS?

My computer hangs every time I try to run the DATAMART process.

Current settings are: SET JAVA_OPTS=-Xmx6000m -Xms3000m -XX:MaxPermSize=500m
-XX:PermSize=300m

Randy Wilson

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help : https://help.launchpad.net/ListHelp

--
Knut Staring
Dept. of Informatics, University of Oslo
+4791880522
http://dhis2.org

With your settings, I think there will be too much paging happening and the heap space is the worst place to page.

The reason for the paging is you might have nearly free 2.5GB RAM available (windows might use the remaining) and you’ve set the heap space from 3Gb to 6Gb, which will always nearly page.

So, I would say the -Xms1024m -Xmx1500m should be safest for 4Gb, given that you’d run parallel GC in some memory that will be beyond the heap.

All of this assuming that you have x64 Java as well… just having windows x64 won’t be enough.

···

Regards,
Saptarshi PURKAYASTHA

My Tech Blog: http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE

On 22 February 2013 22:53, Wilson,Randy rwilson@msh.org wrote:

Does anyone have suggestions for the optimal settings for JAVA_OPTS on a 4 gig Windows 7 64 bit OS?

My computer hangs every time I try to run the DATAMART process.

Current settings are: SET JAVA_OPTS=-Xmx6000m -Xms3000m -XX:MaxPermSize=500m -XX:PermSize=300m

Randy Wilson


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Another thing I forgot to mention is that Hotspot still likes allocating memory in 256k chunks.

So -XX:MaxPermSize=256M is more ideal

All of this will change with Java8, where PermGen is going to be replaced similar to JRockit… but that’s for another day.

···

Regards,
Saptarshi PURKAYASTHA

My Tech Blog: http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE

On 23 February 2013 02:22, Saptarshi Purkayastha sunbiz@gmail.com wrote:

With your settings, I think there will be too much paging happening and the heap space is the worst place to page.
The reason for the paging is you might have nearly free 2.5GB RAM available (windows might use the remaining) and you’ve set the heap space from 3Gb to 6Gb, which will always nearly page.

So, I would say the -Xms1024m -Xmx1500m should be safest for 4Gb, given that you’d run parallel GC in some memory that will be beyond the heap.

All of this assuming that you have x64 Java as well… just having windows x64 won’t be enough.


Regards,
Saptarshi PURKAYASTHA

My Tech Blog: http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE

On 22 February 2013 22:53, Wilson,Randy rwilson@msh.org wrote:

Does anyone have suggestions for the optimal settings for JAVA_OPTS on a 4 gig Windows 7 64 bit OS?

My computer hangs every time I try to run the DATAMART process.

Current settings are: SET JAVA_OPTS=-Xmx6000m -Xms3000m -XX:MaxPermSize=500m -XX:PermSize=300m

Randy Wilson


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Thanks for the quick response. I've found that the only way to be sure that the new settings show up in DHIS-2 on topcat is to create a setenv.bat file in the tomcat\bin folder. Setting it as an environment variable seems to be less reliable.

Randy

···

-----Original Message-----
From: Knut Staring [mailto:knutst@gmail.com]
Sent: Saturday, February 23, 2013 2:46 AM
To: Wilson,Randy
Cc: dhis2-users@lists.launchpad.net
Subject: Re: [Dhis2-users] Optimal settings for JAVA_OPTS on a 4 gig Windows 7 computer?

Hi Randy,

This is proobably not the solution, but just yesterday I had a problem on a laptop with Windows 8 where it appeared as if the JVM took no notice of my JAVA_OPTS, the reason for which I still fail to comprehend.

So just to make sure, you could try and feed the parameters directly to the Java process as you are starting DHIS2, if you're using DHIS Live you could try something like this from a Command prompt:

java -Xmx6000m -Xms3000m -XX:MaxPermSize=500m -XX:PermSize=300m -jar dhis-live.jar

For Tomcat you could also put it in one of the startup scripts, I guess.

Knut

On Fri, Feb 22, 2013 at 4:53 PM, Wilson,Randy <rwilson@msh.org> wrote:

Does anyone have suggestions for the optimal settings for JAVA_OPTS on
a 4 gig Windows 7 64 bit OS?

My computer hangs every time I try to run the DATAMART process.

Current settings are: SET JAVA_OPTS=-Xmx6000m -Xms3000m
-XX:MaxPermSize=500m -XX:PermSize=300m

Randy Wilson

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help : https://help.launchpad.net/ListHelp

--
Knut Staring
Dept. of Informatics, University of Oslo
+4791880522
http://dhis2.org

Thanks Saptarshi. These settings worked like a charm. I guess I still need to add some more memory if I want to update our big dataset frequently.

Randy

···

The reason for the paging is you might have nearly free 2.5GB RAM available (windows might use the remaining) and you’ve set the heap space from 3Gb to 6Gb, which will always nearly page.

So, I would say the -Xms1024m -Xmx1500m should be safest for 4Gb, given that you’d run parallel GC in some memory that will be beyond the heap.

All of this assuming that you have x64 Java as well… just having windows x64 won’t be enough.


Regards,

Saptarshi PURKAYASTHA

My Tech Blog: http://sunnytalkstech.blogspot.com

You Live by CHOICE, Not by CHANCE

On 22 February 2013 22:53, Wilson,Randy rwilson@msh.org wrote:

Does anyone have suggestions for the optimal settings for JAVA_OPTS on a 4 gig Windows 7 64 bit OS?

My computer hangs every time I try to run the DATAMART process.

Current settings are: SET JAVA_OPTS=-Xmx6000m -Xms3000m -XX:MaxPermSize=500m -XX:PermSize=300m

Randy Wilson


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Hi Randy

Some of this is a bit more voodoo than science … but giving your jvm 6G when you only have 4G will not help the cause (I see Saptarshi has talked about paging). And if you have postgres on the same machine, she needs some too.

DHIS2 has two different stress modes - during the day when it might be fielding lots of connections and at night when its doing this mammoth datamart job. It’s hard to know how to optimize for both. In your case you are only interested in the latter. So its a question of how best to share the memory out between TC and postgres.

I’'d suggest giving 2G to tomcat heap and hopefully leaving about 1G for postgres. Along the lines of:

JAVA_OPTS="-Xmx2G -XX:MaxPermSize=256m"

I am not sure how optimized postgres comes out of the box on windows 8, so could be some useful tweaking there too.

Bob

···

On 22 February 2013 21:53, Wilson,Randy rwilson@msh.org wrote:

Does anyone have suggestions for the optimal settings for JAVA_OPTS on a 4 gig Windows 7 64 bit OS?

My computer hangs every time I try to run the DATAMART process.

Current settings are: SET JAVA_OPTS=-Xmx6000m -Xms3000m -XX:MaxPermSize=500m -XX:PermSize=300m

Randy Wilson


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp