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
Which category the java thread do fall in?
What are disadvantages of java?
What are streams in java 8?
What is class forname used for?
Will minecraft java be discontinued?
What is jvm? How its run?
What is arrays fill in java?
What is meant by class loader? How many types are there?
Java.util.regex consists of which classes?
Which browsers work with java?
What is JVM and is it platform independent?
Does substring create a new object?
What is a heavyweight component?
How do you check if a string contains only numeric digits?
Are maps ordered java?