Important points on GC and Heap
1) Java Heap is divided into 3 generation for sake of GC.These are young generation, tenured or old generation and Perm area.
2) New objects are created into young generation and subsequently moved to old generation.
3) String pool is created in Perm area of Heap, garbage collection can occur in perm space but depends upon JVM to JVM.
4) Minor garbage collection is used to move object from Eden space to Survivor 1 and Survivor 2 space and Major collection is used to move object from young to old / tenured generation.
5) Whenever Major garbage collection occurs application threads stops during that period which will reduce application’s performance and throughput.
6) JVM command line options –Xmx and -Xms is used to setup starting and max size for Java Heap.
7) There is no manual way of doing GC in Java. You can only request for GC.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.