# What is the correct way to configure -Xms and -Xmx for a GSC when using GSA

We're using the GridServiceAgent to start our system. I've set -Xms=1G and -Xmx=2G in EXT_JAVA_OPTIONS, but that does not seem to get propagated to the GSCs that the GSA spawns. What is the correct way to specify the JVM memory for a GSC that is launched via the GSA?

Thanks, Rowland

Edited by: Rowland Smith on Oct 15, 2009 2:35 PM

edit retag close merge delete

Sort by » oldest newest most voted

You should edit \gigaspaces-xap-premium-7.0.1-ga\config\gsa\gsc.xml and have it to call your gsc startup script.
See the following:

            windows="${com.gs.home}/bin/gsc.bat" unix="${com.gs.home}/bin/gsc.sh">

This will set the EXTJAVAOPTIONS and call existing gsc.sh script.
In the same manner you can wrap the gs-agent script.

Shay

more

Thanks for the info - the wrapper script is working fine now.

Rowland

more

Its just a script error

Try adding export -p JAVA_OPTIONS="" in gsc.sh/bat file

GSA is starting GSC and GSM and JAVA_OPTIONS from GSA are getting carried to gsc.sh script and thus it is not considering your EXT_JAVA_OPTIONS

Thanks Venkat

more

Perhaps the real question is: Should I try to set the min/max heap size of the JVM that my GSC will run in?

I start gs-agent.sh (GSA), and it then spawns my GSC(s). Let's say I want the following:

• GSA with 512M of heap.
• GSC with 1G of heap.

As far as I can tell, the only way to change the heap size is by including -Xmx/-Xmn in the EXT_JAVA_OPTIONS environment variable. This variable gets picked up by BOTH the GSA and the GSC, i.e they both get the same memory settings. Do you see my dilemma?

Thanks, Rowland

( 2009-10-20 14:07:55 -0500 )edit

Hey RowLand

If you see my post correctly... you can understand why GSA and GSC are picking up the same configurations

""GSA is starting GSC and GSM and JAVA_OPTIONS variable from GSA are getting carried to gsc.sh script and thus it is not considering your EXT_JAVA_OPTIONS""

In setenv.sh script, if JAVA_OPTIONS variable is available, script ignores EXT_JAVA_OPTIONS... JAVA_OPTIONS variable is set when GSA starts and thus u need to set it to null in gsc.sh to get your gsc take EXT_JAVA_OPTIONS you set for gsc.

( 2009-10-22 15:47:18 -0500 )edit