Originally posted by Vivek Jain: But still what could be the best practices to minimize or avoid garbage collection in Java???
First think of yourself if you really want this. Without garbage collection, objects are never cleaned up, and the heap just fills up until it is full and the JVM throws an OutOfMemoryError.
In general, you don't need to worry about garbage collection in Java. The JVM contains very sophisticated algorithms to make garbage collection as efficient as possible, and you are probably not going to gain much by trying to optimize it.