Can somebody explain this memory usage

Saaa empty at needmail.com
Fri Apr 3 02:31:20 PDT 2009


> 
> > I forgot to mention it is about a program I made :D
> > (not the compiler itself or something)
> >
> 
> I belive you have a bug in line 42.
?
> 
> >> dmd 1.042 Phobos OpenGl + SDL (Derelict)
> >>
> >> mem usage (winxp task manager) = 60MB,  peak = 120MB
> >> gc.fullCollect is run just before mainloop, no change in mem usage
> >>
> >> after 10 minutes or so mem usage has stabilized at 70MB
> >> I have localized this to toStringz usage and think this is why tango's
> >> toStringz has a temp argument.
> >>
> 
> What's the problem? You allocate some memory, GC removes unreferenced objects.

I mean: calling toStringz(and format) a lot will allocate about 10MB of extra memory.

> 
> >> When I minimize and normalize the window, mem usage goes to 4MB.
> >>
> >> I think I don't understand memory (de)allocations.. might be a bad thing
> >> :)
> It's and OS who is swapping your memotry when you minimize your application, not Phobos/Tango or whatever.
> 

I always thought that memory usage would stay the same if you minimize and then normilize an application.


More information about the Digitalmars-d-learn mailing list