The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
June 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Heap Size increase ...

Posted by Ajjaiah BM on November 27, 2001 at 1:43 PM

Hi,
The OutOfMemory exception may be due to two reasons :
1> JavaHeap is full , can't grow further.
2> NativeHeap is full , can't grow further.

I guess you have already found that your application needs more JavaHeap size , here are some tips how to do that.
You should use the non standard java command line options :

-Xmsn
Specify the initial size, in bytes, of the memory allocation pool. This value must be a multiple of 1024 greater than 1MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 2MB. Examples:


-Xms6291456
-Xms6144k
-Xms6m

-Xmxn
Specify the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 64MB. The upper limit for this value will be approximately 4000m on Solaris 7 and Solaris 8 SPARC platforms and 2000m on Solaris 2.6 and x86 platforms, minus overhead amounts. Examples:

-Xmx83886080
-Xmx81920k
-Xmx80m

-Xssn
Set thread stack size. Each Java thread has two stacks: one for Java code and one for C code. This option sets the maximum stack size that can be used by C code in a thread to n. Every thread that is spawned during the execution of the program passed to java has n as its C stack size. The default units for n are bytes and n must be > 1000 bytes. To modify the meaning of n, append either the letter k for kilobytes or the letter m for megabytes. The default stack size is 512 kilobytes (-Xss512k).



I hope this will help ...

Cheers,
Ajjauah BM





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us