WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Process ID

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Physical Memory on remote machine.

Keywords: 	 Physical Memory on remote local machine.

Question

How can you get the 'Total Physical Memory' from a Remote machine? I tried using the process extender to get us memory usage on a remote machine, but the only counter I see regarding memory is total *available* bytes......

Reply:

I didn't find any specific 'performance counter strings' that can specify total physical memory. The closest thing I found was.....

You can approximate the physical memory on a remote machine by querying the following performance counters and summing the total of the 3 following counters:

\\remote\Memory\Available Bytes
\\remote\Memory\Cache Bytes
\\remote\Process\Working Set\ _Total 

Here is some sample code..

NOTE: this code can be used to get physical memory on Local *or* Remote machines....

;Addextender("wproc34i.dll")
Addextender("wwprc44i.dll")
if WinVersion(4) == 4; NT
   availablebytes = tGetData("\\Machine\Memory\Available bytes",0)/1024
   cachebytes = tGetData("\\Machine\Memory\Cache bytes",0)/1024
   totalworkset = tGetData("\\Machine\Process(_Total)\Working Set",0)/1024
   physicalmemMB = (availablebytes + cachebytes + totalworkset)/1024
   str = strcat("Available bytes     : ",availablebytes,@CRLF,"Cache bytes         : ",cachebytes,@CRLF,"Working set total  : ", totalworkset,@CRLF,"_______________________",@CRLF,"Physical Memory (MB): ",physicalmemMB)
   Message("Approximation of Physical Memory",str)
else
  Message("tGetData", "Is designed to run on NT")
endif
exit



Article ID:   W14548
Filename:   Physical Memory on Remote Machine.txt
File Created: 2013:04:01:09:10:56
Last Updated: 2013:04:01:09:10:56