• 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

How to increase java Heap size ?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have got an 'Out of memory Exception'while trying to build using ANT.Inorder to solve this isssue,I think I need to increase the heap size.
Can anyone tell me how to increase the heap size of JVM or let me know if there is any other way of resolving this issue?

Thanks in advance

Thanks& Regards,
Sudha
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use "-Xmx256m" to set the max memory size. "-Xmn256m" to set min memory size

If you enough memory in the machine, say 512 or above, then you can use aggressive heap. This can be used with jdk1.4 or above. So jvm will decide the heap size according to the free memory.

JAVA_OPTS="$JAVA_OPTS -XX:+AggressiveHeap"
 
Sanju Thomas
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it is "-Xms256m" instead of "-Xmn256m"
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All these Java settings are documented in the tooldocs section of the SDK documentation. Unless you are working with limited disk space you really should have those docs on your hard drive.
Bill
 
Popeye has his spinach. I have this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic