• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the default size of java heap

 
SivaRamiReddy Reddy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please can you tell the default java heap
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the 5.0 documentation for the windows java application launcher:
-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. Examples:

-Xmx83886080
-Xmx81920k
-Xmx80m
 
SivaRamiReddy Reddy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do we set our own heap heap memory size
 
Brian Mozhdehi
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You use what Barry stated in is post, which is done at the point where you invoke your program, i.e.

if you invoke your program now using

java <yourclass>

do it like this (for example)

java -Xms32m -Xmx128m <yourclass>

which would start the engine with a minimum size of 32M and a maximum size of 128M

(changed order)
[ August 19, 2006: Message edited by: Barry Gaunt ]
 
Bert Bates
author
Sheriff
Posts: 8900
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll leave it here, but everyone should know that this very interesting discussion will NOT be on the exam.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic