Monodroid: Performing A Full Gc
Solution 1:
The primary problem is that you have too many Java.Lang.Object
instances alive at once, as each Java.Lang.Object
instance contributes to the JNI global reference count, which also contributes to GC overhead. Want to reduce GC overhead? Reduce the number of GREFs you use.
You can track the GREF count by enabling gref logging
adb shell setprop debug.mono.log gref
I assume that Particle
is a Java.Lang.Object
subclass, meaning you have at leastparticles.Count
GREFs alive at once.
The solution is to not make Particle
a Java.Lang.Object
subclass, and alter your architecture in any way to ensure that Particle
isn't one.
If Particle
isn't a Java.Lang.Object
instance, then we lack sufficient information to reproduce the problem and suggest a solution. GREF logging output would be a handy start (how many GREFs do you have at once?), as it will also help you determine which types are being created so you can consider reducing their lifetime.
This guide on reading gref log output may also be handy.
Post a Comment for "Monodroid: Performing A Full Gc"