From: sparhawk AT eunet DOT at (Gerhard Gruber) Newsgroups: comp.os.msdos.djgpp Subject: Re: Remaining memory under OS/2 question Date: Sat, 05 Sep 1998 20:20:38 GMT Organization: EUnet Austria Lines: 45 Message-ID: <35f860ac.2201526@news.Austria.EU.net> References: <35eb49be DOT 27826391 AT news> <35eb853a DOT 16135542 AT news DOT Austria DOT EU DOT net> <35f0bff3 DOT 9073000 AT news DOT pacific DOT net DOT sg> NNTP-Posting-Host: e237.dynamic.vienna.at.eu.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Date: 5 Sep 1998 20:22:28 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Content-Transfer-Encoding: 8bit Precedence: bulk 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.