title: Questions related to Garbage Collector and finalize() method
body: <p>I was reading about Garbage Collection and finalize() method of Java and there are some of the doubts that caught my mind. Sorry if you think that these doubts are really silly.</p>
  
  <ol>
  <li><p>I was reading the article <a href="http://javarevisited.blogspot.com/2011/04/garbage-collection-in-java.html" rel="nofollow">http://javarevisited.blogspot.com/2011/04/garbage-collection-in-java.html</a>. In this, point 5  says:
  <em>'Before removing an object from memory Garbage collection thread invokes finalize() method of that object and gives an opportunity to perform any sort of cleanup required'.</em>
  So does this thing happens for sure? I mean will the finalize() method be always called before execution of Garbage Collector method?</p></li>
  <li><p>How does the Garbage Collector knows that it needs to execute? For example, I have an application deployed on server, so when does the GC executes? Does it executes periodically, or when some (say 1MB) amount of garbage is collected and a trigger is executed or something or it is just random and there's no way to determine when will it execute?</p></li>
  <li><p>How does it degrade the performance of my application since the garbage collection isn't happening?</p></li>
  <li><p>Suppose I have a lots of garbage in my heap but the garbage collector isn't executed. If this happens, so isn't it a bad behavior or a flaw of JVM?</p></li>
  <li><p>Can we say that garbage collection which is done manually in C/C++ better than in Java taking the consideration that we as a programmer are smart enough and know when we need to dispose off the 'not-so-referenced' pointers?</p></li>
  </ol>