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 |
Explain jvm, jre, and jdk?
Where the CardLayout is used?
What are event-delegation model and event-inheritance model? Which is best?
What is difference between filereader and bufferedreader?
What is a for loop in java?
What is the primitive type short?
what do you mean by marker interface in java?
Can we sort set in java?
Why java is used everywhere?
What is mean by exception?
What is a singleton class? Give a practical example of its usage.
Is there any way to skip finally block of exception even if some exception occurs in the exception block?