Monday, September 7, 2015

Garbage Collection

First we should understand the meaning of garbage collection is normal life, It means collection unused components from society and dispose them in proper manner So It can used again after recycling.

Ex: In today's society we use plastic bags, and after using them plastic is deteriorate in quality, so we have to dispose it. So in municipal corporation pick these plastic bags and Send for recycling, then we got low quality plastic bags again.



In that respect of Operating System, we need memory object to store different kind of values. and after using them collect these object's and give back to OS if we think a very abstract level for comman understanding.

In Ruby, before allotment of memory, ruby creates a free list or free linked list.
which has multiple object in terms of memory, these memory is allotted in OS Heap area. So whenever any momory is requested by ruby code, any object of free list will be allotted to it.
So in abstract level, we have free linked list and a tree (Executing code).
active object's that has reference of Executing code.

No comments:

Post a Comment