When application is running low of memory - Garbage collector run

Q.  When does Garbage collector run?
- Published on 16 Jun 15

a. When application is running low of memory
b. It runs random
c. When application is running for more than 15 minutes
d. None of the above

ANSWER: When application is running low of memory
 

    Discussion

  • Shiva   -Posted on 13 Sep 15
    While doing programming, a programmer creates the object, use it and generally forget to delete. Garbage collector is automatic memory management process that releases the memory used by the objects. Garbage collector runs automatically and it checks for objects in the managed heap that are no longer used by the application and performs the necessary action to regain memory.
    It allows us to develop an application without having worry to free memory.
    If you want to call garbage collector forcefully, then you have to use gc.collect() method.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)