[Mulgara-dev] Lost phase token

Alex Hall alexhall at revelytix.com
Thu Sep 24 14:50:03 UTC 2009


Paul Gearon wrote:
> On Wed, Sep 23, 2009 at 6:35 PM, Life is hard, and then you die
> <ronald at innovation.ch> wrote:
>> Also, Paul, is it not the case that only inserts/deletes create new
>> phases? I.e. when would you ever see a phase having been created by an
>> Answer?
> 
> You wouldn't. Writes are what create new phases. That's what phases are about.

In this regard, the stack trace that gets logged with the "lost phase
token" message is a bit misleading. Simply creating a phase initializes
it in an unreferenced state, but the phase token isn't created until the
phase is used. Read operations are what use phases and cause them to
have their reference count incremented.

The FreeList class maintains a list of all open phases ("open" meaning a
phase that was created and has a non-zero reference count). Pretty much
every FreeList operation triggers a call to clean unused phases from
this list, which should free them up to be garbage-collected. If phases
are staying in this list, then you need to find out where they are being
used. Perhaps it would be more useful to record the StackTrace object in
FreeList.Phase.use() instead of the FreeList.Phase constructor.

-Alex



More information about the Mulgara-dev mailing list