When Does the Garbage Collector Run in JVM ?

  • The garbage collector is under the control of the JVM. 
  • The JVM decides when to run the garbage collector.
  • Using Java program you can ask the JVM to run the garbage collector

        but there are no guarantees, under any circumstances, that the JVM       
        will comply.

  • JVM will typically run the garbage collector when it senses that memory is running low. 
  • Experience indicates that whenyour Java program makes a request for garbage collection, the JVM will usually grant your request in short order, but there are no guarantees. Just when you think you can count on it, the JVM will decide to ignore your request.


About rajkirpal

i am a software engineer. and i have decent knowledge about java technologies like ANDROID, Servlet, Jsp, Struts, Hibernet, Spring, J2ME, Java Script, Ajax, JQuery, CSS. Further i am Preparing Easy understandable materials/documents upon the same java technologies and developing project in core java , advanced java and j2me , ANDROID as per the requirements Also designing the web sites and logos Thank You.
This entry was posted in J2SE. Bookmark the permalink.

One Response to When Does the Garbage Collector Run in JVM ?

  1. Pingback: Sing's Tech Musings » Blog Archive » Java Garbage Collection Algorithm Design Choices And Metrics To Evaluate Garbage Collector Performance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s