• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.OutOfMemoryError: Java heap space

 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i am creating an xlsx file with more that 100000 rows.




and i am gettign the error:

java.lang.OutOfMemoryError: Java heap space

i googled and found that the java heap size need to be increased, but I am confused either to increse it in Tomcat or eclipse or command line. As I am using these three in my project. Also i dont want to increase the heap for one specific application , as i have 2 more running .

Also please suggest me the commands to increse the heap size.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"rocx sum", please check your private messages for an important administrative matter. Failure to do so will result in the removal of your account.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15480
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this is part of a web application, then you will need to change the memory settings in the Tomcat configuration. Lookup the documentation for your specific version of Tomcat to find out how to do that.

If it is part of a standalone Java application that you run from the command line, then you'd need to add a -Xmx option to the command. For example:

java -Xmx1024m org.mypackage.MyProgram

to give it a max of 1024 MB (1 GB) memory.
 
ravi khonal
Greenhorn
Posts: 1
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added a new environmental variable named JAVA_OPTS = -Xms1024m -Xmx1024m -XX:MaxPermSize=128m


Still i am getting the same error.

My tomcat is plugged into Eclipse and in eclipse.ini file i tried changing the -vmargs and gave -Xms1024m -Xmx1024m .
But Eclipse failed to start after this changes and i revert back the previous settings.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic