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 is a vector in java?
Why for each loop is used?
Can we have a abstract class withought any method? What is a purspose of this?
Can I extend singleton class in java?
Is java se free?
Can an unreachable object become reachable again?
why ,we are using jsp and html.which one is better?
Can an abstract class be a final class?
Is a case study a method or methodology?
How do you identify if jvm is 32-bit or 64-bit from java program?
How can we handle runtime exceptions? write one sample program? Can we write runtime exceptions beside the throws key word? if yes write sample program?
Given: 1. package test; 2. 3. class Target { 4. public String name = “hello”; 5. } What can directly access and change the value of the variable name? 1 any class 2 only the Target class 3 any class in the test package 4 any class that extends Target