3 ms·
I can only think that the GC has a bug. From [1], the GC is incremental, but I suspect it's not guaranteed to make forward progress, because it's not collecting
by barrkel 17y ago
I can only think that the GC has a bug. From [1], the GC is incremental, but I suspect it's not guaranteed to make forward progress, because it's not collecting large orphaned object graphs.
Object pooling may or may not make sense depending on whether the GC is generational or not, and how large the graph of live objects normally is. In a non-generational GC, the whole object graph will need to be traced to free any garbage at all, which means that if your live set of objects is large - and hence expensive to trace - you'll want to minimize the number of allocations, and pool almost as much as possible, especially if the GC is non-incremental and users can perceive freezes during a GC.
In a generational GC, cheap objects should not be pooled, but it may make sense to pool objects that are expensive to allocate or collect. For example, in .NET large objects like long arrays (over 40K bytes IIRC) are allocated in a special heap that's only collected with a full GC. Pooling those guys makes a lot of sense, because dropping them as garbage will force full GCs too often.
I would expect most modern GCs to be compacting (and generational), to avoid fragmentation, the cost of keeping track of a free list and improve locality, but if there's a lot of interop between the GC managed memory and native code, then updating references may be problematic.
[1] http://192.150.8.60/devnet/flashplayer/articles/garbage_collection.html http://192.150.8.60/devnet/flashplayer/articles/garbage_coll...
- chipsy 17y agoAVM2 is currently non-generational, so it benefits from pooling. This works out just fine for Flash games, since you generally want games to have a highly static data set anyway - otherwise performance is just all over the place. AVM2 also has the "Alchemy memory" since Flash 10 which adds a whole new option, independent of the GC, for tightening your space/time constraints: http://lab.polygonal.de/2010/03/15/memorymanager-revisited/ http://lab.polygonal.de/2010/03/15/memorymanager-revisited/