[Mono-devel-list] Limit Garbage Collection

Vorobiev Maksim MVorobiev at croc.ru
Tue Jul 19 06:57:04 EDT 2005

Garbage collection cann't be replaced with alloc/free model - it breaks
.NET enviroment fundamentals. But if you want to escape long-time
collections, you should design your software do not use dynamic object
creations. Create all your objects at start-up and keep references to
them, declare your types as "value" ones - so they'll be created at
stack, not in heap.
BTW, you can try to use System.WeakReference to model your "garbage
list". See details in MSDN or any .NET-books.
At last, you can have some control over GC with System.GC class.
As the last chance, you can use interop with native code...but it has
it's own pit falls.

Well, there is no silver bullet, so .NET is not the best platform for
active-grapthics game development or some types of calculations. It was
oriented for bussiness applications. So, think twice for all pro and
contras with platform selection.

-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Cedric Le
Sent: Tuesday, July 19, 2005 2:23 PM
To: mono-devel-list at lists.ximian.com
Subject: [Mono-devel-list] Limit Garbage Collection

Dear all,

Please accept my apologies if a similar question has been asked, I have
not been able to find a question to it.

.Net is an incredible step in the interroperability of languages. Nearly
all software developpements can use garbage collection. Unfortunately,
some others cannot like game developpement. Typically, a game cannot be
reasonnably freezed more than 20 ms (50 frames per second). Sometimes
requirements are even higher.

Is there a way with mono to disable garbage collection and use the old
desalloc model?
Is there a way to "cheat" and instead of really desollocating an objet
of a particuliar type to put it in a garbage list. This garbage list
will be used for the next allocation of the same type...

What are your thoughts?

Thanks for your time,


Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com

More information about the Mono-devel-list mailing list