[Vm-dev] What is a free object

Michael Haupt mhaupt at gmail.com
Thu Jul 26 13:20:43 UTC 2007


Hi Mathieu,

On 7/26/07, Mathieu Suen <mathk.sue at gmail.com> wrote:
> I was reading the code of the nextInstance primitive and  to
> undertand I need to know what is a FreeObject:

since Squeak (fortunately) has a garbage collector, the heap does not
just consist of actual objects, but also of chunks of unused memory.
However, these also have an object header to be more easily handled:
during allocation, the memory manager must be able to find a free
piece of heap memory to assign it to the newly allocated object. These
chunks of free memory are what the VM code calls "free objects".

> Why are they inside the image? When are they created?

They are inside the image because the image is a snapshot of a running
system, possibly including pieces of free memory. They are created as
the garbage collector frees memory when objects are deallocated.

I hope this makes some sense.

Best,

Michael


More information about the Vm-dev mailing list