Wednesday, July 23, 2014

Garbage Cullector in Java or Android at the case of Stack overflow Exception or stack out of memory Exception



It is use to make memory free from stack and heap by using
System.gc();
There objects will create new memory space and clean create then memory will not bound or not stack overflow. Because of memory are free by garbageCullecter  .gc();

Mostley or most of the cases memory overflow or Stackoverflow Exception generate in that case System.gc(); will work well.

memory leakage problem comes down from when ever our memory of inatialization is full at that time memory overflow to containing values of objects and variables 

Data store in to heap or as well as in heap 

in Stack Data declearation store only 

But in Heap there store Declearation initialization defination containing objects store in heap .
Always heap full at the case of Stack overflow .in same time inatialize memory of stack Not give responce to that task related all variables ...etc 

Then we have need Garbage collector.

System.gc();


commands of increasing Space of Memory up to /4
which is depends on RAM
if RAM is 4 gb then you can increase the size of heap and stack up to 1 gb
by use full commands

It is possible to increase heap size allocated by the JVM by using command line options Here we have 3 options

-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



 

it make memory clean and re nationalization of memory at heap and stack   

No comments:

Post a Comment