Having gone through a lot of pages in the web, I have now an idea and would like to share to you guys.
There are mainly 2 types of GC, they are
- Reference counting collectors
- Tracing garbage collectors
and traversing the entire root set.The reachable object are marked are being 'in-use'
Not 'in-use' object 's memory would be cleared in every stage of Garbage Collection.
Ananology:
In an untidied room, there are some usable things and some rubbish in every corners of the room. We find out the usable object and mark them as usable and throw away all non-marked items.
We would focus on the tracing garbage collectors, that Java is using.
沒有留言:
張貼留言