File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java heap space exception(outofmemoryexception)

 
Tilak Gorantala
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Team,

I am building a war using Maven through command prompt. I am getting an error as - "Java Heap Space exception" after compiling using maven. Please tell me how to increase heap memory size.

Thanks,
Gopi.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're getting the exception during the maven compilation, then there's probably a maven command line arg or pom element you can set to specify heap size. You'd have to look at maven's docs or google for something like how to set heap size in maven.

If you're getting while running your app, after compiling, then maven doesn't have anything to do with it. You can adjust the max heap size by adding a -Xmx arg to the JVM command line. Something like:


Since you're talking about a .war file, I assume this is a web app running under tomcat or jboss or something. The container will most likely have a config file or startup script where you can specify the heap size.

However, it may also be that your app needs more memory than you have available--either due to a design flaw or due to an actual requirement.
 
Tilak Gorantala
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeff,

It worked, I just increased my heap size to 1GB. Now my war file is almost built. Thanks for your quick reply. :-) :-)

Thanks,
Gopi.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic