Hello,
I am seeing very poor garbage collection performance, even for quite small
memory sets. here is a log from my game, I am seeing 35seconds+ for
collection of less than a Meg.  (These are not extraordinarily small or
large objects, just some bitmaps/fonts maybe a sound)

Also note the case where the garbage collection was performed and the memory
usage actually got larger! 

Here is the code I use for the logging/GC

        /// <summary>
        /// forced garbage collection
        /// </summary>
        public static void GarbageCollect()
        {
#if DEBUG
            Log.Info("++++++++ FORCED GARBAGE COLLECTION +++++");
            Log.Info("Before: " + GC.GetTotalMemory(false).ToString());
            DateTime dt = DateTime.Now;
#endif
            GC.Collect();
#if DEBUG
            Log.Info("After: " + GC.GetTotalMemory(false).ToString());
            Log.Info("Took " + (DateTime.Now - dt).TotalMilliseconds +
"ms");
#endif
        }

Here is the resulting log...

12-07 01:46:42.883: INFO/EXTERMINATOR(23357): Created
Exterminator.InvoiceScreen
12-07 01:46:42.883: INFO/EXTERMINATOR(23357): Stop all Sounds
12-07 01:46:42.883: INFO/EXTERMINATOR(23357): Accelerometer stopped
12-07 01:46:50.016: INFO/EXTERMINATOR(23357): Created
Exterminator.WarningScreen
12-07 01:46:50.016: INFO/EXTERMINATOR(23357): ++++++++ FORCED GARBAGE
COLLECTION +++++
*12-07 01:46:50.023: INFO/EXTERMINATOR(23357): Before: 6863832
12-07 01:47:25.578: INFO/EXTERMINATOR(23357): After: 7059952
12-07 01:47:25.578: INFO/EXTERMINATOR(23357): Took 35555.756ms*
12-07 01:47:25.664: INFO/EXTERMINATOR(23357): Created
Exterminator.PickJobScreen2
12-07 01:47:25.687: INFO/EXTERMINATOR(23357): Stop all Sounds
12-07 01:47:25.687: INFO/EXTERMINATOR(23357): ++++++++ FORCED GARBAGE
COLLECTION +++++
*12-07 01:47:25.687: INFO/EXTERMINATOR(23357): Before: 7059952
12-07 01:48:02.141: INFO/EXTERMINATOR(23357): After: 7028176
12-07 01:48:02.141: INFO/EXTERMINATOR(23357): Took 36453.064ms*
12-07 01:48:12.336: INFO/EXTERMINATOR(23357): Created
Exterminator.JobOrderScreen
12-07 01:48:12.336: INFO/EXTERMINATOR(23357): ++++++++ FORCED GARBAGE
COLLECTION +++++
*12-07 01:48:12.344: INFO/EXTERMINATOR(23357): Before: 7048144
12-07 01:48:39.859: INFO/EXTERMINATOR(23357): After: 7023264
12-07 01:48:39.859: INFO/EXTERMINATOR(23357): Took 27520.233ms*
12-07 01:48:39.859: INFO/EXTERMINATOR(23357): Request Play Sound Bleep
12-07 01:48:39.859: INFO/EXTERMINATOR(23357): Playing Sound Bleep
12-07 01:48:39.875: INFO/EXTERMINATOR(23357): PLAYSOUND Bleep
12-07 01:48:39.914: INFO/EXTERMINATOR(23357): Load Resource Misc/drop2
12-07 01:48:39.914: INFO/EXTERMINATOR(23357): Loaded Resource Misc/drop2


Cheers
Warren

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Garbage-Collection-performance-can-be-very-poor-new-Mono-for-Android-tp5055044p5055044.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to