Wednesday, October 12, 2016

Garbage Collection for Performance Optimization

Sysytem.GC -> Kicks in Garbage Collection manually

Mark and Sweep Collectors
CMS, G1, GenPar and DeterminiticGC

Mark each object to live bit and then sweep phase starts looking for unmarked heap allocation and reclaims them.

DISADVANTAGES:

Dependent and amount of live data on heap – Pause time challenge

Friday, June 24, 2016

Multithreading

Strong Reference
Regular variables that are in JVM memory until the program completed

Soft Reference
They are taking out of JVM memory when JVM gets full.

Weak Reference
They stay in memory until it is Garbage Collection is called by user/automatically.

Phantom Reference
Cannot get the value by using normal get method - it stays in reference queue and not in JVM

DEADLOCK
JConsole or VisualVM are the tolls - Kill -3 is the command