Re: clustering of objects in a VM



The simple answer is yes it can be done. Generally it is implicit via a
temporal proximity ordering.

I.e., if during say, an ephemeral collection cycle, two objects were
accessed within the same ephemeral cycle the collector knows what memory was
accessed where and can arrange to place the objects within the same memory
blocks.

But, even if it didn't, it would presumably still be placing all the
ephemerally accessed objects in the same quasi-newspace and thus they would
be in a much smaller block of memory.

Now, take this further in consideration of modern caching architectures and
recognize that the goal is to have as small a working set of memory as
possible being accessed so that it can all be in the cache. A crafted GC can
actually populate and keep such caches primed based on object access
information it knows implicitly from either object structure usage (design)
or ephemeral access (heuristic) knowledge.

This is even more true in the S# AOS VM system that segregates common header
/ fields of objects from their less frequently used extensible portions.

-- Dave

"Ian Upright" <ian-news@xxxxxxxxxxx> wrote in message
news:lvjak19k08fs60lha47dkrrd5d16r7c94h@xxxxxxxxxx
> I'm fairly naive when it comes to the implementation of modern VM and GC
> architecture, so I have a question, being curious as to how this works.
>
> When the garbage collector is moving about all the objects, does it
> "cluster" related objects together in the same memory space? For example,
> lets say we have objectA, and it referenced objectB, and that second
> object
> referenced an objectC. Now, lets also assume that there are no other
> references in the system to objectB and objectC.
>
> Does the gc do a breadth-first copying of all the live objects, in such a
> way that objectA, objectB, and objectC are pushed right up against each
> other, clustered in the same physical space in memory?
>
> If so, this could have potentially a huge impact on performance, whereas
> even using a C++ garbage collector, the objects could be physically
> scattered all over the place, and since all the references are very
> static,
> things aren't going to improve or get reclustered better over time.
>
> So I'm curious about Smalltalk VM's, Java VM's, etc, if anyone knows about
> the underlying implementation of in memory clustering of objects.
>
> Ian
>
> ---
> http://www.upright.net/ian/


.



Relevant Pages

  • Re: to dispose or not ?
    ... always have the system memory roots available. ... collector for the Gen0 and Gen1 heaps and a mark/sweep/compact collector for ... heap or compacts free space out of the heap. ... the reference from the variable to the object in the heap. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: [patch 1/6] mmu_notifier: Core code
    ... external references to pages managed by the Linux kernel. ... access memory managed by the Linux kernel. ... The MMU notifier will notify the device driver that subscribes to such ...
    (Linux-Kernel)
  • Re: [PHP] Odd PHP memory issue
    ... all references to the result variable are unset when I ... to see if the memory is getting chewed up in a straight line or if it ... Scope seems like it should be simple, ... posting this question was to find out more about how PHP internals work, ...
    (php.general)
  • Re: to dispose or not ?
    ... always have the system memory roots available. ... It also means that MS took some shortcuts in the garbage collector to improve the performance of finalizers. ... the reference from the variable to the object in the heap. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Writing huge Sets() to disk
    ... that this code takes a lot of extra memory. ... > I believe it's the references problem, ... It's a bit unfortunate that all those instance variables are global to ... it merely aggregates it for use in storing new Python objects. ...
    (comp.lang.python)

Loading