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 |
what state does a thread enter when it terminates its processing? : Java thread
Is java hashset ordered?
how to run servlet program between two computer through the internet ?
2 Answers Kiran Prakashan, TCS,
When is the garbage collection used in Java?
Which java ide is used the most?
what is difference between set and list in collection?
what are the differences between final,finally,finalize methods?
Why java is said to be pass-by-value ?
I want to re-reach and use an object once it has been garbage collected. How it's possible?
What is hash table in java?
Describe string intern() methodology
When should I use stringbuffer?