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
Name the components that are termed to be Heavy-weight component but available in Light-weight components?
What java is used for?
What are the differences between string and stringbuffer?
What is byte value?
Can we overload the constructors?
Define packages in java?
What is keyword in oop?
Can we call thread start () twice?
What is difference between overloading and overriding in java?
Can we convert list to set in java?
Explain about main thread in java?
Is a char always 1 byte?
When do you call copy constructor?
what is recursion in java
Explain different states of a thread in java?