File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes java.lang.OutOfMemoryError: Java heap space Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "java.lang.OutOfMemoryError: Java heap space" Watch "java.lang.OutOfMemoryError: Java heap space" New topic
Author

java.lang.OutOfMemoryError: Java heap space

carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

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

Joined: Jan 10, 2002
Posts: 56183
    
  13

"rocx sum", please check your private messages for an important administrative matter. Failure to do so will result in the removal of your account.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12911
    
    3

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
ravi khonal
Greenhorn

Joined: Jan 18, 2012
Posts: 1
check out this link guys,,

http://javarevisited.blogspot.com/2011/05/java-heap-space-memory-size-jvm.html
carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.OutOfMemoryError: Java heap space
 
Similar Threads
Download file from Mysql database
Pizza and Servlets
Servlet can not show the proper photo from database
apache pio?
how to solve class not found exception and data not insert in database