Heap memory :-
When ever objectt create then object get memory from heap.
Heap memory size in 32 bit hardware will be /4 of physical
memory
And by default it can be /16
We can increase size of heap up to 25 % of physical memory
Ex 4 gb of ram then we can make heap up to 1 gb
Because of ¼ we can
increase size of heap from physical memory ……
Commands
of initialized memory to jvm
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
java
-Xms16m -Xmx64m ClassName
we can increase or decrease size of heap when our server or
jvm willl be close then we can do these commands use …
Heap
and Non-Heap Memory
The JVM memory consists of the
following segments:
- Heap Memory, which is the storage for Java objects
- Non-Heap Memory, which is used by Java to store loaded classes and other meta-data
- JVM code itself, JVM internal structures, loaded profiler agent code and data, etc.

·
Java objects reside in an area called the heap. The heap is created when
the JVM starts up and may increase or decrease in size while the application
runs. When the heap becomes full, garbage is collected. During the garbage
collection objects that are no longer used are cleared, thus making space for
new objects.
·
Note that the JVM uses more memory than just the
heap. For example Java methods, thread stacks and native handles are allocated
in memory separate from the heap, as well as JVM internal data structures.

No comments:
Post a Comment