Does garbage collection guarantee that a program will not
run out of memory?
Answer Posted / 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 View All Answers
Difference between arraylist and hashset in java?
What are the types of java languages?
Explain about instanceof operator in java?
Is cout buffered?
Why pass by reference is not possible in java?
Tell me a few examples of final classes defined in Java API?
How to sort list of list in java?
What is meant by the value of a variable?
What is the locale class in java programming?
What are the 6 boolean operators?
What is a numeric digit?
write a program that list all permutations of ABCDEF in which A appears before B?
What is slash r?
What is singletonlist in java?
What is a module function?