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



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

Answer / ranganathkini

Garbage Collection of Java is an automatic mechanism that
safeguards against memory leaks and handles memory
allocation and de-allocation.

The GC makes all possible attempts to free memory and make
it available for fresh allocations. But at certain times it
cannot. At those times, it throws an OutOfMemoryError.

So to conclude, GC handles most of the memory management and
makes all possible attempts to make memory availabe for the
application but it does not gurantee that it will be able to
provide it.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the exact difference in between Unicast and Multicast object?

0 Answers  


What does java ide mean?

0 Answers  


How to access a variable if it is declared as private?

3 Answers  


Explain features of interfaces in java?

0 Answers  


What is passing by reference in java?

0 Answers  






When do you get classcastexception?

0 Answers  


what is the difference between applet and swing and gui application in java . What we do with the collections set and list interface

2 Answers   CTS, Phoenix Technologies,


Can we override the static method?

0 Answers  


What is the purpose of the main method?

0 Answers  


Explain the difference between arraylist and linkedlist in java?

0 Answers  


Can we override constructors in java?

0 Answers  


What is a numeric format?

0 Answers  


Categories