Re: Problem with memory leaks

From: Fabian Schmied (REMOVETHISfabianDOTschmied_at_fhs-hagenbergDOTacDOTat)
Date: 05/17/04

Date: Mon, 17 May 2004 10:04:46 +0200

Rich [Microsoft Direct3D MVP] schrieb:
>>Well, I can't remember that I ever seen an application, which usesd for the
>>display of two boxes 200 MB (sorry, than I breaked, because of memory
>>shorting) in roaund about 3 Minutes, without a memory leak., It looks like
>>the applikaction would never end reserving memory. And I don't think that it
>>is normal for managed DirectX.
> Like I said, you don't seem to understand how .NET works. It will
> happily use a large amount of memory before it starts garbage
> collecting. Go read about how memory is managed in .NET before you
> start claiming its a leak. Particularly since .NET doesn't *let* you
> leak memory unless you're using #unsafe code blocks and an unmanaged
> memory allocator.

Well, it might not be a leak (because the GC reclaims it; still .NET
*lets* you leak memory in safe code, if you just keep references alive,
that's quite easy to do without wanting using events, btw), but 200MB in
three minutes just for displaying two cubes sure seems like a lot of
memory allocations. Looking at the samples, they eat a lot less memory.