Garbage collection has certain disadvantages which are as following: Garbage collection uses computing resources so that to take a decision that which memory shall be reconstruct or free the fact to which programmer is well-aware of. When object lifetime is not manually annotated in source code, penalty is overhead. It will reduce the performance. Overheads are not bearable or tolerable, when interaction is present to memory hierarchy effects. It is not easy to predict them during
Garbage collection is automatic memory management in computer sciences. Garbage collector attempts to reclaim garbage or occupied memory of the object that is not in use of program. In 1959, Garbage collection was invented by John McCarthy to solve the Lisp problems.
Usually garbage collection and manual memory management are considered opposite of each other. Objects are required by programmers which are returned or deallocated to the memory. Various approaches are taken into consideration
Java provides support for its memory management by using its built-in mechanism. In Garbage collector, two threads run.
• Responsibility of 1st thread is memory collections, primarily heap. It is quite light weighted.
• 2nd thread is considered to be a full “GC thread”. When comes memory shortage, entire heap is
traversed by it. Spaces for the objects are allocated by it.
When there is inadequate heap allocation or memory leak then full GC thread runs
In this post, I will talk about Java performance Issues briefly.
The output of a Java compiler is a bytecode and not an executable code. The Java Virtual Machine (JVM) interprets the Java bytecode at runtime. Most of the modern programming languages such as C, C++ are not interpreted and compiled to the executable code because of the performance concern. When a program is interpreted, it generally executes slowly when compared with an executable code.