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 |
Can we define private and protected modifiers for variables in interfaces?
Explain the available thread states in a high-level?
What is multithreading and its advantages?
How does queue work in java?
What is the difference between iterator and enumeration ?
What are the different types of java?
When you Click a Button, What event will be fired?
What are the two types of java programming?
What is the public method modifier?
What package is math in java?
what is purpose of writting public static void main(Strind arg[]) in java..?
How does compareto work in java?