yes, GC is different now, and much better at that.
The old system worked like this...
Let's say that your UI was using 10MiB after the last GC. You run for a while and eventually eat your way up to 12.5 MiB. System stops, all memory is scanned, recovered, and you're back at 10MiB. If you're eating a lot of memory these scans happen more often, and can even create a short pause, which users like to call "lag" even though that isn't an accurate description of the problem.
New system:
You start at 10MiB again. Over some time, let's say 5 min, you eat your way up to 20MiB. The new GC now kicks in, it does small "steps" instead of one complete pass like the old system. It tries to recover memory at twice the rate you're consuming it. That basically means that, if your consumption rate stays steady, over the next 5 minutes your memory use will decrease at the same rate it was increasing. In the end, on average, you'll spend half your time consuming memory and half the time recovering it.
End result: the GC threshold is a lot higher. Since GC is now spread out in steps, the performance impact is also spread out over time. No more "lag" when a GC cycle happens.
Last edited by Tekkub : 12-15-06 at 06:39 AM.
|