# gsInstance and more memory

Hello Folks, I wonder if somebody can help me out with this:

I am trying to start up a space via the "gsInstance" script. I use gsInstance.sh instead of gsServer.sh since the jini lookup service is launched already as a seperate process.

The space I want to run needs quite a lot of memory to hold all of its entries so my script looks a bit like this:

+... export JAVA_OPTIONS="-Xmx1024m" export LOOKUPGROUPS="test" ... .../GigaSpacesEE-5.2/bin/gsInstance.sh '/./mySpaceA' '' '' ...+

To my surprise, it looked like the property JAVA_OPTIONS was ignored. ( +it was not -Xmx512m was added up in the command line+ ) A quick inspection on gsInstance.sh followed by setenv.sh showed me the following:

setenv.sh

{code}

#

#

# JAVACMD - The Java command-line

*# JAVA_OPTIONS - Java command-line options for running the server,

# ... ...

# Set up JVM options base on value of JAVA_VENDOR

if [ "$PRODUCTION_MODE" = "true" ]; then case$JAVA_VENDOR in BEA) JAVA_OPTIONS="${JAVA_OPTIONS} -server -showversion -Xmx512m" #-Xgc:gencon" ;; HP) JAVA_OPTIONS="${JAVA_OPTIONS} -server -showversion -Xmx512m" ;; IBM) JAVA_OPTIONS="${JAVA_OPTIONS} -showversion -Xmx512m" ;; Sun) JAVA_OPTIONS="${JAVA_OPTIONS} -server -showversion -Xmx512m" ;; *) JAVA_OPTIONS="${JAVA_OPTIONS} -showversion -Xmx512m" ;; esac else case$JAVA_VENDOR in BEA) JAVA_OPTIONS="${JAVA_OPTIONS} -server -showversion -Xmx256m -Xgcreport -Xmanagement -verbose:memory,cpuinfo" ;; HP) JAVA_OPTIONS="${JAVA_OPTIONS} -server -showversion -Xmx256m" ;; IBM) JAVA_OPTIONS="${JAVA_OPTIONS} -showversion -Xmx256m -verbose:gc -Xquickstart" ;; Sun) JAVA_OPTIONS="${JAVA_OPTIONS} -server -showversion -Xmx256m" ;; *) JAVA_OPTIONS="\${JAVA_OPTIONS} -showversion -Xmx256m" ;; esac fi export JAVA_OPTIONS ... {code}

So that's it: when I was running gsInstance my command line was looking like this:

{color:blue}java -Xmx1024m -showVersion -Xmx512m ... {color}

that's bizzarre. I must be missing something. How come I can't set up more than 512m of memory for my space/gsInstance application ? I have +temporarily+ changed gigaspaces' "setenv.sh" and I have been able to start up gsInstance with the correct amount of memory and it has worked. Can somebody please tell me that I don't have to modify "setenv.sh" but I am just missing some simple trick ?

Many Thanks Lorenzo