File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes Java heap space exception(outofmemoryexception) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Java heap space exception(outofmemoryexception)" Watch "Java heap space exception(outofmemoryexception)" New topic
Author

Java heap space exception(outofmemoryexception)

Tilak Gorantala
Greenhorn

Joined: Jan 18, 2013
Posts: 21
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

Joined: Jan 03, 2004
Posts: 6109
    
    6

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

Joined: Jan 18, 2013
Posts: 21
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
 
subject: Java heap space exception(outofmemoryexception)