• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Java heap space exception(outofmemoryexception)

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic