On Nov 3, 2013, at 1:07 PM, Niko Matsakis wrote:

> 
> In any case, Brendan's e-mail suggesting tenuring weakly referenced
> objects offered one possible workaround for maintaining top nursery
> performance in the face of weak refs. (I have no idea, of course, if
> this is what the JVM does.)
> 

Tenured (if by that you mean stays around until an exhaustive GC) seems 
somewhat contrary to the whole point of using a weak map. Many apps may never 
trigger that level of GC in which case using a WeakMap (even with explicit 
deletes) under that policy would actually be worse  than using a regular Map.

But the basic concept isn't all that crazy.  One of the advantages of having a 
hierarchy  of generations is that you can apply different policies at different 
levels of the hierarchy (in my experience an Ungar GS-style configuration is 
too simplistic).

For example, in the nursery you might treat WeakMaps as having strong reference 
and also any remembered set entries into the nursery also as strong references. 
 Hence, little, if any,  WeakMap overhead needed to scavenge the nursery. 

Allen


_______________________________________________
dev-tech-js-engine-internals mailing list
dev-tech-js-engine-internals@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to