Hi. Nebwie here. THe first question is if objects are moved (changed the address in memory) at runtime? I am 99% sure the answer is true. If so:
1) Who moves them ? the GC? 2) when ? agains which events, what triggers these movements? 3) why they are moved? to compact the memory ? why the memory needs to be compact? for arrays? 4) Is there a way to say "please, don't move this object X" ? what would be the problem of having a lot of these "non-moveable" objects? memory fragmentation ?
If you can point me to the code also I would be happy.
Thank you very much in advance,
Mariano
On Mon, Jul 19, 2010 at 6:16 AM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
Hi. Nebwie here. THe first question is if objects are moved (changed the address in memory) at runtime?
yes.
I am 99% sure the answer is true. If so:
- Who moves them ? the GC?
yes.
- when ? agains which events, what triggers these movements?
during garbage collection
- why they are moved? to compact the memory ? why the memory needs to be
compact? for arrays?
In Squeak's case to compact memory. But scavenging/two-space-collection is a widely used technique that works by copying the live objects from one space into another, com[acting as it goes, and so it is expected with modern algorithms that memory is compacted as garbage is collected. See Paul Wilson's Uniprocessor Garbage Collection Techniqueshttp://www.complang.tuwien.ac.at/ulrich/gcsurvey.ps.gz .
- Is there a way to say "please, don't move this object X" ? what would
be the problem of having a lot of these "non-moveable" objects? memory fragmentation ?
Not yet. I'm working on it for Teleplace's threaded Cog VM.
If you can point me to the code also I would be happy.
See the garbage collection and gc protocols in ObjectMemory and (in Cog) NewObjectMemory in VMMaker.
Thank you very much in advance,
Mariano
HTH Eliot
vm-dev@lists.squeakfoundation.org