简体   繁体   中英

How to increate heap space for java in linux using .bash rc file

I am geting below exception while running my java code in linux server. java.lang.OutOfMemoryError: Java heap space

Could you please tell me the way to overcome in linux server.

How to increase java heap space by using .bashrc file in linux server?

Thanks in advance.

Do as follows:

export _JAVA_OPTIONS="-Xmx10g"

To be sure that it is working, whenever you run a java file, it should output: Picked up _JAVA_OPTIONS: -Xmx10g

I'm sure this has been answered before, but something like

export JAVA_OPTS=-Xmx1024m

Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM