Anyone know how task manager monitors memory use?

BlitzMax Forums/BlitzMax Programming/Anyone know how task manager monitors memory use?

Grey Alien(Posted 2007) [#1]
Basically if you run a simple blitz app that loads in some images then frees them up by nulling them and using GCCollect, Task Manager will still show large memory use. Does it just keep the memory "reserved" in case you use it again in a short while, or is it some kind of leak? (I doubt it).

I know a while ago I found a big leak caused by playing sounds on a channel and freeing the channel (by setting it to null) without caling StopChannel first. Seems you must use Stop Channel or the memory use goes up and up.

Well anyway I'm keen to know how task manager works and if it's a reliable too for spotting memory leaks outside of BMax of if there is another better tool? Any info appreciated, thanks.


FlameDuck(Posted 2007) [#2]
Does it just keep the memory "reserved" in case you use it again in a short while, or is it some kind of leak?
Yes. It's called memory pooling. The basic idea is that since reserving / freeing memory is a very expensive operation on some operating systems, it is desirable not to do it more often than necessary. This is why when you start a .Net application the CLR will (by default) just grab half of all your available memory, regardless of the size or complexity of your application.

of if there is another better tool?
Try googling for "memory debugger" / "memory profiler".


Grey Alien(Posted 2007) [#3]
ok thanks.