Mail Archives: djgpp/1998/09/05/16:30:49
Destination: fesenko AT pacific DOT net DOT sg (Victor)
From: Gruber Gerhard
Group: comp.os.msdos.djgpp
Date: Sat, 05 Sep 1998 04:37:09 GMT:
>The thing is that I'm running only my program at highest priority,
>there are no other programs running under OS/2. So I assume under
>these circumstances I can use remaining memory value to assess any
>memory leaks. Please, correct me if I'm wrong.
I wouldn't bet on it, because a preemptive multitasking system is not fully
deterministic. Depending on your drivers, caches and so on what are currently
in memory you could nevertheless get different results. Also you don't know
about the OS how it behaves. Does it flush out old data while your program is
running and if so how do you know that. The best method to track memory leaks
is to watch your code with loggings or with libraries that support such
things. Everything else may be unpredictable. I was working once under the
same assumption on Windows 95 and I watched the resourcemeter after my program
closed. I got the impression that there are memory leaks and so I checked my
code with no result. Then I detected that thr resourcemeter seems to update
the display after quite some time. I don't know if the system didn't free the
resources while it was idle of if the RM took so long to realize that. The
same may apply to any other system resources you are using, therfore I
wouldn't recommend that approach unless you exactly know how the system
behaves.
--
Bye,
Gerhard
email: sparhawk AT eunet DOT at
g DOT gruber AT sis DOT co DOT at
Spelling corrections are appreciated.
- Raw text -