RAM usage reported in TM?

  • Thread starter Thread starter Terry Pinnell
  • Start date Start date
Terry said:
Why doesn't XP Task Manager show RAM currently in use please? I'd have
thought it an important item to display explicitly under the
Performance tab?

https://dl.dropboxusercontent.com/u/4019461/XP-TM-RAM.jpg

I don't think Task Manager is a "tool for accountants".

Your instantaneous memory usage is "Commit Charge (Total)".
AFAIK Commit Charge (Total), is the memory line graphed
on the screen.

I have no idea how "available" the available portion is.

Even though mine has 3144748 of Physical Memory (Total)
to offer, I find it gets twitchy above around 26xxxxx or
so. Pushing it until the Available is zero, just isn't
practical. It becomes more practical, if you have a
fast storage device for the Pagefile, such as an SSD
or a RAM drive. I've tried with a RAM drive, to hold
the Pagefile, and the response was buttery smooth.
You couldn't tell it was swapping. I've had 5GB of
programs open that way, and it all worked fine. And
that's because the RAM drive, at 4GB per second, with
close to zero seek time, makes it that way. An SSD should
be similarly impressive, compared to using a hard drive
for the pagefile.

*******

If you like to experiment, I wrote this terrible code, to
test memory allocation. It allocates one megabyte of RAM
at a time, and measures the time to fill it. I fill the
memory, to make sure the compiler doesn't optimize out the
loop.

When you start swapping to the Pagefile, the timings will
slow down. The interface becomes so slow, that pressing
"control-c" into the command prompt window you run the
program in, hardly stops it. It's intended to give you a
quick idea, how much RAM you can use, before the RAM usage
has an impact on overall system performance.

I expect I compiled this in MinGW, which you can download
and install. I have my copy of MinGW, installed in a virtual
machine, to avoid cluttering up C: .

************************ malloc.c **************************

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>

/* No attempt was made to clean up this code. Copied verbatim
from the working copy, and this message added to it */

/* gcc -o malloc.exe -Wl,--large-address-aware malloc.c */

BOOL WINAPI handler(DWORD dwCtrlType)
{
if (CTRL_C_EVENT == dwCtrlType)
{
exit(0);
}
return FALSE; /* This is a control-C handler, that doesn't help */
}

int main (int argc, char *argv[])
{

SetConsoleCtrlHandler(handler, TRUE); /* Arm control-C handler */

__int64 time1 = 0, time2 = 0, freq = 0;
QueryPerformanceCounter((LARGE_INTEGER *) &time1); /* For timing stuff */
QueryPerformanceFrequency((LARGE_INTEGER *)&freq);

int i = 0;
void *m;

while ( (m = malloc(1024*1024)) != NULL ) {
memset(m,0,1024*1024);
i++;
QueryPerformanceCounter((LARGE_INTEGER *) &time2);
printf("%05d megabytes t=%010.6f\n", i, (float)(time2-time1)/freq);
}
}

********************** end malloc.c ************************

Paul
 
Back
Top