Re: Determining Process Memory Usage

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thank you for your help Paul. I will look into ToolHelp API. I know the best
way to debug this is by reproducing the issue inhouse (which I haven't been
able to do yet). I guess I just have to keep trying :)

"Paul G. Tobey [eMVP]" wrote:

You might be able to write a supervisor program which would use the ToolHelp
API to get heap information for each and every running process and store
that somewhere periodically. If it's not your code that's leaking, I'm not
sure what you'd be able to do with the information (let's say that
device.exe is at fault). You'd still have to be able to debug to get
anywhere with a fix.

Paul T.

"Kap" <Kap@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B07193A8-6B42-493B-84A2-B8153993FD7B@xxxxxxxxxxxxxxxx
We have few thousand units out there in various locations and they are
idential in all possible ways. They all doesn't show any memory leaks
execpt
at one location. All units at that location (5 units) demonstrate this
memory
leak. I have remote tools working but I can't reproduce the issue at my
desk.
It's not possible for me to go there just for debugging. That's why remote
tools aren't much of a help in this situation.
I can trap my allocations in the code as you said but I doubt it's my code
that's doing it since vast majority of the units don't demostrate the
leak. I
just wanted to log the memory usage for each process to atleast find out a
clue of what's going on.
Thanks.

"Paul G. Tobey [eMVP]" wrote:

Well, you could trap new and delete, malloc and free, etc. with your own
library and keep track of what is allocated and what is freed.
Examination
of your code is often the fastest way to find leaks, though and you don't
need remote tools for that. If you still aren't sure, I can recommend a
tool, but it's going to need a remote connection, just like the MS remote
tools. Entrek TOOLBOX is *very* good at this. Why are remote tools a
problem?

Paul T.

"Kap" <Kap@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:05735CF7-1D74-46C0-8FC2-2D5BA18E913D@xxxxxxxxxxxxxxxx
May be I need to explain my situation here then. I have a device that
appears
to have a memory leak. I found it out by periodically logging the
memory
allocated by the system as a whole (using GlobalMemoryStatus function).
Now I
need to find out if this leak is caused by any of the processes I am
running
on the device. Can any one show me some light on how to do that without
using
the remote debugging tools?
Thanks.

"Paul G. Tobey [eMVP]" wrote:

There's not going to be that sort of information. Data is not paged
out,
ever.

Paul T.

"Kap" <Kap@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E735D4D4-AACF-4035-8BDC-6F9E19AFF094@xxxxxxxxxxxxxxxx
Basically what's available through GetProcessMemoryInfo(). I am
specifically
interested in PeakWorkingSetSize and WorkingSetSize. What I am
trying
to
do
is to monitor total heap usage of a given process over time.

"Paul G. Tobey [eMVP]" wrote:

What do you mean by "memory status of a process"? What are you
trying
to
find out?

Paul T.

"Kap" <Kap@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3C8FD7AD-2A27-49F5-AD37-A81B33379997@xxxxxxxxxxxxxxxx
Windows CE doesn't support GetProcessMemoryInfo(). The fuction
GlobalMemoryStatus() gives you information about physical and
virtual
memory
of the system as a whole but not on process by process basis. I
am
in
an
environment where I can't use remote debugging tools. Is there
anything
similar to GetProcessMemoryInfo in CE? How do I determine the
memory
status
of a process?
Thanks.












.



Relevant Pages

  • Re: Memory leak in the Driver
    ... Paul G. Tobey wrote: ... Don't forget that "handles" are memory, too, as are USB packets, data ... and *you* are supposed to free it, could be the source of the leak. ... driver development, it's most likely that you are at fault. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Determining Process Memory Usage
    ... Paul T. ... They all doesn't show any memory leaks ... leak. ... I have remote tools working but I can't reproduce the issue at my ...
    (microsoft.public.windowsce.embedded)
  • Re: Memory leak in the Driver
    ... Paul G. Tobey wrote: ... driver development, it's most likely that you are at fault. ... The QFE has no impact on the leak but one thing is sure, ... i am sure that all the memory that i am allocating in my driver is ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Determining Process Memory Usage
    ... All units at that location demonstrate this memory ... I have remote tools working but I can't reproduce the issue at my desk. ... that's doing it since vast majority of the units don't demostrate the leak. ... Paul T. ...
    (microsoft.public.windowsce.embedded)
  • Re: Memory leak in the Driver
    ... if the following application is used then, there is no memory leak. ... Paul G. Tobey wrote: ... you are building a driver for? ...
    (microsoft.public.windowsce.platbuilder)