Does garbage collection guarantee that a program will not run out of memory

Garbage collection does not guarantee that a program will not run out of memory. It ispossible forprograms to use up memory resources faster than they are garbage collected. It is alsopossible forprograms to create objects that are not subject to garbage collection

Showing Answers 1 - 1 of 1 Answers

The garbage collection is JVM dependent then It is possible for programs to use memory resources faster than they are garbage collected.Moreover garbage collection cannot be enforced,it is just suggested.The garbage collection is unpredictable, thus we cannot predict exactly when the finalize method will run. Once a variable is no longer referenced by anything it is available for garbage collection.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions