🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3104

Memory Status / determine virtual memory usage of a process

#3104
From: Uli
Date: Thu, 05 Oct 2006 13:07
19 lines
1768 bytes
Hello,

is there a way to determine the memory-status of a specific process in the 
way TaskManager does it? That means retrieving the amount of physical and 
virtual memory usage.

I played around with  the Toolhelp functions in conjunction with 
Heap32ListFirst/Heap32ListNext and Heap32First/Heap32Next but however, the 
calculated amount of memory usage based on these functions (adding up the 
portions of LF32_FIXED / LF32_FREE / LF32_MOVABLE) does not fit to the 
values shown in TaskManager. Additionally there's no way to distinguish 
between physical and virtual memory chunks when using these functions. Also 
the iteration through all the heap-chunks seems to be rather slow ...

So, is there a better and more reliable way to do this? (Where does 
TaskManager get the information from?)

Thanks,
Uli. 
Technical Details
Message-ID: <45250397@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,aba0bbbda094b5c8,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Uli" <nospam@nospam.de>
From: "Uli" <nospam@nospam.de>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Memory Status / determine virtual memory usage of a process
Date: Thu, 5 Oct 2006 15:07:33 +0200
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
NNTP-Posting-Host: 217.91.12.142
Message-ID: <45250397@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1160053655 217.91.12.142 (5 Oct 2006 06:07:35 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail