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
What are methods in java?
How do you square a number?
Which arithmetic operations can result in the throwing of an arithmeticexception?
How does linkedhashmap work in java?
Can we have return statement in finally clause? What will happen?
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
What is the purpose of a transient variable?
What is busy spin, and why should you use it?
What is the use of parse function in java?
How many threads can java run?
How is final different from finally and finalize?
I want to re-reach and use an object once it has been garbage collected. How it's possible?
Why java is a platform independent? Explain
Can you inherit from an abstract class java?
What is math in java?