Garbage colector

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
Melssj5
Posts: 27
Joined: Mon Sep 05, 2005 6:05 am

Garbage colector

Post by Melssj5 »

Hi, I am doing an aplication, but the memory usage increases very very fast.

I tried using seting a Nothing value to the variables, but it doesnt work

Also calling GC.Collect () but nothing, what can I do, I have errors for the memory each 15 animations
the_bob
Posts: 37
Joined: Fri Dec 09, 2005 6:49 pm
Location: Michigan

not observed

Post by the_bob »

I haven't observed this myself yet, but without more details on how large your app is, I can't say I've done anything similar. You may want to note that, as of yet, I think the IRR.net version is just a wrapper for the native version. That's why you have to inlude the native .dll in your executable folder.

That said, if the problem lies in the native version of the engine, the memory is likely not "managed", and therefore would not be cleaned up by the GC.Collect() method.

If I happen to see this myself, I'll dig a little deeper. Right now, I'm just waiting anxiously for austcro to tell us all that a pure .net version is ready and give us a sourceforge link. Then, we'll have more control over such things.
3D in .NET - Who would've guessed!
austcro

Post by austcro »

I thought I would weigh in here and comment.

Talk about pressure hey the_bob :D

In my limited dealings with managed c++ I'm pretty sure that each class that deals with unmanaged resources must also implement the IDisposable pattern as you would with plain c#. I had a look at the wrapper, albeit 0.12 because 0.14 doesn't have a .sln file - least the one I downloaded anyway and it does not do this. Yes, it does have a destructor, but the destr. must call Dispose(),
just as the c# finalizer would call Dispose() and GC.SuppressFinalize(this).

Just a tip, it usually isn't necessary to call GC.Collect as it puts more pressure on the GC. Let it do it's job and everything should be a-ok.

Maybe Niko can comment here as I am not sure how managed c++ deals with this. Maybe useless bit still nteresting to note, apparently vc++ 2005 does not need to implement IDisposable.

Anyway, my two cents
Locked