How to allocate space to JAVA using command line
java
Solution
Try (note quotes are not optional with two words)
export JAVA_OPTS="-Xms4096m -Xmx4096m"
Or, even
export MIN="4096m" # <-- Those quotes are (one word).
export MAX="4096m"
export JAVA_OPTS="-Xms$MIN -Xmx$MAX" # <-- single quotes would break variable expansion
Problem
I have come across heap errors while loading a large dataset into Jena. `Is there some way by which I may allocate the JVM(Java) a large heap space. I know I can achieve this by making changes into eclipse.ini. But is there some way by which I may increase the Java heap size using command line in linux (I using a 64GB RAM server: running 12.04 Ubuntu LTS server)? The error which I am getting due to less heap space is: exception in thread main gc overhead limit exceeded. Also how can I find the maximum amount of heap space which I can set for my systems I tried export JAVA_OPTS= -Xms4096m -Xmx4096m but ended up getting the error: bash: export: `-Xms4096m': not a valid identifier bash: export:`-Xmx4096m': not a valid identifier