Query with Garbage Collection
-
I was reading article on Garbage Collection. I have below queries- 1) There are many objects in my heap and stack and memory is getting low. How Garbage Collector will come to know which object to recollect? 2) Is there any property in object that tells GC that it can collect that object? 3) What is the need of three garbage collector generation? Where are these generations located(physical or logical)?
-
I was reading article on Garbage Collection. I have below queries- 1) There are many objects in my heap and stack and memory is getting low. How Garbage Collector will come to know which object to recollect? 2) Is there any property in object that tells GC that it can collect that object? 3) What is the need of three garbage collector generation? Where are these generations located(physical or logical)?
-
I was reading article on Garbage Collection. I have below queries- 1) There are many objects in my heap and stack and memory is getting low. How Garbage Collector will come to know which object to recollect? 2) Is there any property in object that tells GC that it can collect that object? 3) What is the need of three garbage collector generation? Where are these generations located(physical or logical)?
Rahul Hanumant Chavan wrote:
- What is the need of three garbage collector generation?
The need is so that the GC can optimize its behavior. It can be reasonably sure that older generations will not need to be collected.
The difficult we do right away... ...the impossible takes slightly longer.
-
I was reading article on Garbage Collection. I have below queries- 1) There are many objects in my heap and stack and memory is getting low. How Garbage Collector will come to know which object to recollect? 2) Is there any property in object that tells GC that it can collect that object? 3) What is the need of three garbage collector generation? Where are these generations located(physical or logical)?
This is too big a topic to answer in a simple forum query - I suggest that this article[^] would be a valuable place to start your further reading.
This space for rent
-
I was reading article on Garbage Collection. I have below queries- 1) There are many objects in my heap and stack and memory is getting low. How Garbage Collector will come to know which object to recollect? 2) Is there any property in object that tells GC that it can collect that object? 3) What is the need of three garbage collector generation? Where are these generations located(physical or logical)?
Quote:
What is the need of three garbage collector generation? Where are these generations located(physical or logical)?
Different generations need to manage different kinds of objects. Small objects created locally in functions have small live time and small size. They should be controlled in different way comparing to big objects with high live time. Number of generations depends on GC realization. Physical or logical - I do not understand exactly what do you mean, but if GC uses virtual memory it can be considered as logical.