TASKLIST.EXe vs TASKMGR

T

TomM

Using TASKLIST from the command line, formating the output as a CSV, and
brining into Excel,shows the memory usage for all processes as say 300B
(vaires os system to syatem, so use this as an example).

using TASKMGR on the same PC can show 1GB or more in the PF Usage bar, or in
Toal Comitted K

I've domne a side by side comparison, and can't find any processes in
TASKMGR which are not listed in the TASKLIST output , but cannot account for
the apparent extra memory usage

How can I account for the difernce between what TASKLIST says the proceeses
are using what TASKMGR says is committed
 
V

VanguardLH

TomM said:
Using TASKLIST from the command line, formating the output as a CSV, and
brining into Excel,shows the memory usage for all processes as say 300B
(vaires os system to syatem, so use this as an example).

using TASKMGR on the same PC can show 1GB or more in the PF Usage bar, or in
Toal Comitted K

I've domne a side by side comparison, and can't find any processes in
TASKMGR which are not listed in the TASKLIST output , but cannot account for
the apparent extra memory usage

How can I account for the difernce between what TASKLIST says the proceeses
are using what TASKMGR says is committed

How about all the tasks for the operating system that aren't listed?
How about all the drivers that aren't listed?
 
T

Twayne

Those are sort of an apples & oranges to try to make comparisons
between. List is showing you ONLY tasks/processes that are running.

Where the Manager is showing a LOT more, including background programs &
applications, those tasks from above, and more. It's showing you a lot
more than just the process list.
It's made even more confusing by their naming conventions since
"process" in one doesn't mean the same thing it does in the other.

From the relevant HELP sections:

Tasklist:
This command line tool displays a list of application(s) and
associated task(s)/process(es) currently running on either a local or
remote system.

Task Manager provides:
information about programs and processes running on your computer.


You have to be careul of how you use those numbers, too. Windows "uses"
as much RAM as it can, including some sent to the pagefile. But it's
not NECESSARY for all of that to be loaded in order for the OS to
function. The "extra" stuff is an anticipation of what you might need
next, in order to make it work faster and seem speedier than if they
weren't preloaded like that.
In addition, note that some of those numbers are peak, not current
also.

Are you sure you're looking a a Gig of pagefile usage or the total size
of the pagefile? Those are two different things, too. The pagefile
might be 1.5 Gig, but only a few hundred Meg of it are actually being
utilized (Usage).
If your pagefile "usage" (not total pagefile size) is up to a Gig,
then you must be experiencing some pretty good slowdowns in doing things
with your computer at those times. That much pagefile being used
indicates a serious shortage of RAM for that particular machine if it
happens more than very very little. A proper amount of RAM will keep
your pagefile usage down around a few hundred meg constantly, but the
total size of it will always be the same.

On top of the above information, you should have noticed that
Taskmanager also included bit and pieces of other programs you have,
right? They're the preloads so that programs can start faster. If you
look at your System Tray, each one of those will show in the Taskmanager
"processes" tab, but "processes" in this sense, as you may recall, means
more than what it does in tasklist.

Tasklist is literally the operating system processes (tasks) and nothing
more. Taskmanager includes nearly everything and still leaves a few
things out.
I don't think you can correlate the two that way.
How about all the tasks for the operating system that aren't listed?

The shown tasks are all ones which you have contol over and can start,
stop, or disable etc.. There are probably thousands of other OS
activities that aren't listed in either of those; that's not their
purpose.
How about all the drivers that aren't listed?

Drivers are not considered to be proccesses of tasks in the definition
of those two apps. Those are another, different part of the world of
the OS<g>.

I'm by no means an expert on all this. I'd recommend searching the MS
site for these two applications and probably Google or your favorite
search engine would unearth several interesting things, too.

Good luck, & HTH,

Twayne
 
T

TomM

Thanks both,

next question therfore would be. How can I get a definitive list of
everyhting, programs, prcesses, drivers etc etc that are loaded and taking up
RAM. Is there a native way ion the OS, or wil I have to resort to 3rd party
tools
 
K

Ken Blake

next question therfore would be. How can I get a definitive list of
everyhting, programs, prcesses, drivers etc etc that are loaded and taking
up
RAM. Is there a native way ion the OS, or wil I have to resort to 3rd
party
tools


Why do you want such a list? What would you try to do with it? If it's
because you want to minimize the amount of RAM in use, let me point out that
wanting to minimize the amount of memory Windows uses is a counterproductive
desire. Windows is designed to use all, or nearly all, of your memory, all
the time, and that's good not bad. Free memory is wasted memory. You paid
for it all and shouldn't want to see any of it wasted.
Windows works hard to find a use for all the memory you have all the time.
For example if your apps don't need some of it, it will use that part for
caching, then give it back when your apps later need it. In this way Windows
keeps all your memory working for you all the time.
 
T

TomM

Thanks Twayne,

very helpful. it is the PF Usage graph, in the perfromance tab of TASKMGR,
that is showing upwards of 1GB. Which roughy equates to Total Commit Cahrge
(K)

I have founnd the following definitiosn of both

"PF Usage - This is the total number of committed pages on the system. It
does not tell you how many are actually written to the page file. It only
tells you how much of the page file would be used if all committed pages had
to be written out to the page file at the same time."

"Commit Charge - Total - This is the total virtual memory that has been
committed. This includes all committed memory for all processes and the
kernel."

We are indeed noticing slow performance, and paging, which is exactly why
I'm trying to find out what is taking up the RAM. In most instances pagefile
size wil be 1.5GB.

I know everything is pointing to needing extra RAM, but I'm trying to
justify/prove it. They (the client) will want to know why it needs extra
RAM. It's not going to be enough for me to say TASKMGR says this, therefore
we shouild add extra RAM.
 
V

VanguardLH

TomM said:
Thanks both,

next question therfore would be. How can I get a definitive list of
everyhting, programs, prcesses, drivers etc etc that are loaded and taking up
RAM. Is there a native way ion the OS, or wil I have to resort to 3rd party
tools

The missing part of the equation is just how much FREE physical memory
do you have now? Anything that is free is unused and unused memory is
wasted memory. Check your peak consumption in Task Manager.
 
J

John John (MVP)

It is difficult, if not impossible, to account for exact memory usage on
NT operating systems but by using Perfmon and select performance
counters you can get a fairly close accounting of memory usage.

To obtain the physical memory usage first determine memory usage by the
Operating System and Device Drivers by adding the following Memory
Object counters:

+ Pool Nonpaged Bytes
+ Pool Paged Resident Bytes
+ System Cache Resident Bytes
+ System Code Resident Bytes
+ System Driver Resident Bytes
------------------------------
= Total Bytes used by the Operating System and Device Drivers

Now that we know the memory usage by the Operating System and Device
Drivers we can use the Memory Available Bytes counter and simple
arithmetic to obtain the correct size of the Total Process Working Set size:

+ Total RAM installed in the computer
- Available Bytes
- Total Bytes used by the Operating System and Device Drivers (above)
-------------------------------------
= Total Process Working Set Bytes**

The Total Process Working Set Bytes can also be obtained from Perfmon's
Process(_Total) Working Set Bytes counter, but the value reported by the
counter will differ from the calculated value. Running processes share
memory pages, these shared pages hold shared DLLs that can be used
by many different processes. Although the shared DLLs are only loaded
into memory once, the Total Process Working Set Bytes counter counts
every "usage" instance of shared DLLs. If a shared DLL is used by four
different applications the Total Process Working Set Bytes will count
the memory usage by the DLL four times, the DLL will be counted in each
of the individual Process Working Sets thus inflating the actual value
of the shared memory pages. The calculation above returns a more
accurate value for the Total Process Working Set Bytes.

To obtain RAM usage we simply sum up the two totals above:

+ Total Bytes used by the Operating System and Device Drivers
+ Total Process Working Set Bytes
---------------------------------------
= Total RAM Usage

In short, a quick but less accurate RAM usage figure can be obtained by
adding up the following four Perfmon counters:

+ Process(_Total) Working Set Bytes
+ Cache Bytes (Total System Working Set)*
+ Pool Nonpaged Bytes
---------------------------------------
= Total RAM Usage
+ Available Bytes
---------------------------------------
= Total RAM installed in the Computer
=======================================

As explained earlier, because of shared pages the total may differ to
the actual RAM installed.

* The Cache Bytes counter is the Total System Working Set, the Cache
Bytes counter is an aggregate of the following Memory Counters:

+ Pool Paged Resident Bytes
+ System Cache Resident Bytes
+ System Code Resident Bytes
+ System Driver Resident Bytes
----------------------------
= Cache Bytes or System Working Set Bytes

**The above calculations will yield a close estimate of memory usage on
NT operating systems, bear in mind that certain Operating System
components have no associated Memory Object Counters and obtaining
values for these items is difficult, in the above examples memory usage
by these components is accounted by default in the Total Process Working
Set Bytes calculations.

John
 
T

Twayne

TomM,

OK, I see what you're after now I think. You simply want to see whether
you have enough RAM and are over-using your pagefile (previously known
as the swap file). You've found good information below, but the
unfortunate part is that they are not very good about describing what is
actually being USED of the committed areas. The program available at:

http://www.dougknox.com/xp/utils/xp_pagefilemon.htm

At first it looks like a static window but if you watch, you will see
the use part of the pagefile change.
is an excellent tool for seeing what use is being made of the pagefile.
It's a VB6 program, meaning it doesn't install into the registry except
for Add or Remove Programs, and works out of the box. I'll leave it for
you to read the fine detail but basically it displays a running tally of
the amount of the pagefile being used. Keep in mind, you are interested
in the amount of the pagefile that is IN USE; it is DIFFERENT than the
size of the pagefile.

if you do a Google search for
zp +pagefle +monitor +display
you'll find a plethora of hits with good information and about anything
you could want to know on the subject.

This is a link I think does an excellent job of describing the parts
that are so confusing:
http://www.aumha.org/win5/a/xpvm.php

HTH

Twayne
 
T

TomM

John,

Thanks for this. Well explained. Whilst the mechanics of using pefmon were
familair, the interpreation of the counters were less so. I now have
something concrete to work with
 
T

TomM

John,
once againthanks for this. can you shed any light on a previous post of mine
=======================
As I recall, in NT land, you could configure a Counter log, and then save the
configuration in a file which was then portable to another PC. You could
then either
use the interface, or the Logman command to run/start and stop the log.

I can't find a way to do this in XP. I can save the settings to an HTML
file, which I can then open in an MMC by selecting "Log settings from". I
don't want to do this howver, as I don't want my user community having to go
through all that nonsense. I want to be able to use Logman from within a
batch file to start and stop the loggging as appropriate.

Can I do this

========================

It would be extremely helpful, especially in light of the infomation you
already given me
 
J

John John (MVP)

Set your counters as you want them then save it as a Microsoft
Management Console file (*.msc). Your users will be able to launch it
by simply double clicking on the .msc file.

Also note that you can also monitor the pagefile usage with Perfmon.
Unlike the Task Manager, the readings supplied by perfmon will provide
accurate readings of actual pagefile usage. The readings will be given
as percentages of the pagefile so you will have to get the size of the
pagefile (in Explorer.exe, or other) and do the math to get the readings
in MB.

John
 
T

TomM

Excellent article John, I'd previously only used LOGMAN with START and STOP
to a data set I'd saved earlier. Looks like time to get my hands dirty
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top