Article View: borland.public.cppbuilder.nativeapi
Article #13454Re: SetProcessWorkingSetSize
From: Bob Gonder
Date: Mon, 13 Oct 2003 16:37
Date: Mon, 13 Oct 2003 16:37
34 lines
2318 bytes
2318 bytes
Chris Buys wrote: >Unfortunately the work the DLL does eats up memory like there's no tomorrow. >In the Win2000 TaskManager the memory usage for that process keeps going up >and after 30 min to 1 hour Win2000 runs out of page memory and throws an >error. Does the dll do file io? On my 98 system, when I had set the file cache size to 0, memory would go away slowly. Apparently 0 is infite size for the cache. Giving Win _some_ cache fixed that problem. Just a non-programming thought as to the cause of your symptoms. >So I want to keep the working set of the memory down to sane levels with the >SetProcessWorkingSetSize API call. > > if (SetProcessWorkingSetSize(P,1048576,2097152) = false) then Where did P come from? It's probably not right. GetCurrentProcess() should work better for P. In any case, SetProcessWorkingSetSize isn't going to fix your problem. All it does is limit the amount of real memory you use. Your app can and will still fill the paging file to overload. (At least, that's what the help says) >I've already checked the DLL's code for any possible memory leaks, but could >not determine any. Any ideas? Does your app return objects (that the DLL created) back to the DLL for deletion (correct)? Or does the app delete them itself (incorrect). P.S. Please don't cross-post.
Technical Details
Message-ID:
<svjlov8j1h7dbivc638mjdscjaurv20dbs@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f8ac433@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,656eae8ed23df311 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-10-13 09:40:24 PST From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: SetProcessWorkingSetSize Date: Mon, 13 Oct 2003 09:37:00 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <svjlov8j1h7dbivc638mjdscjaurv20dbs@4ax.com> References: <3f8ac433@newsgroups.borland.com> X-Newsreader: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.31.164.153 X-Trace: newsgroups.borland.com 1066063019 67.31.164.153 (13 Oct 2003 09:36:59 -0700) Lines: 36 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail