Who to make a RAM Test ?

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
nasdo AG
Posts: 14
Joined: Wed Sep 16, 2009 6:06 am

Who to make a RAM Test ?

Post by nasdo AG »

I want to test my RAM usage, who can I create the test for this.?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

What exactly kind of RAM? Physical memory available to all processes? Virtual memory? "Working set" for some process? Address space available for some process?
There are various counters offered by Performance Counters and WMI providers so you may use Performance Counter or WMI test methods.
E.g.
- Select PageFileUsage from Win32_Process where Caption = 'some_process_name.exe'
- Select VirtualSize from Win32_Process where Caption = 'some_process_name.exe'
- \Memory\Available MBytes

More information about these test methods
http://www.ks-soft.net/hostmon.eng/mfra ... ts.htm#wmi
http://www.ks-soft.net/hostmon.eng/mfra ... erfcounter

Regards
Alex
psharp
Posts: 3
Joined: Fri Jul 02, 2010 2:51 pm

Post by psharp »

Is there a way to capture Memory Usage as a percentage? Just like you have the CPU Usage.

If you go to task manager you see at the bottom Processes \ CPU Usage \ Physical Memory. I would like to capture those if possible.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I think Task Manager shows value of "\Memory\% Committed Bytes In Use" performance counter. So you may use Performance Counter test method to check this counter.

Also you may use WMI test method and query like
select PercentCommittedBytesInUse from Win32_PerfFormattedData_PerfOS_Memory

Regards
Alex
psharp
Posts: 3
Joined: Fri Jul 02, 2010 2:51 pm

Post by psharp »

I have looked into to both of those on a couple different servers and they dont seem to match the basic MEMORY %% that windows displays.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

It matches what Task Manager shows on my system :roll:
Anyway, HostMonitor can display any numeric or string counter provided by Performance Counter or WMI classes. Just select counter that you want to monitor.
If Task Manager gets some information using some other API or undoumented functions, HostMonitor cannot do this.

Regards
Alex
psharp
Posts: 3
Joined: Fri Jul 02, 2010 2:51 pm

Post by psharp »

I am not running anything special. Just Windows Server 2003 and 2008.

Your saying on your Windows 2008 box it matches the Physical Memory %% on the Processes tab in Task Manager?

Mine is not even close
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Then may be Task Manager uses TotalVisibleMemorySize and FreePhysicalMemory counters provided by Win32_OperatingSystem class :roll:
Percentage := FreePhysicalMemory/TotalVisibleMemorySize*100

If you want to get value of several counters in one test, you need to create your own script or external application and use Shell Script, Active Script or External test methods to launch script.
We recommend Shell Script
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell

Regards
Alex
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

PS
You may use script like this

Code: Select all

'-----------------------------------------------------------------------
'this script checks percentage of Free Physical Memory on Windows system
'parameter: <minimum_limit>
'designed for Shell Script test method:
'http://www.ks-soft.com/hostmon.eng/index-tests.htm
'-----------------------------------------------------------------------
Option Explicit

const statusAlive       = "scriptRes:Host is alive:"
const statusDead        = "scriptRes:No answer:"
const statusUnknown     = "scriptRes:Unknown:"
const statusNotResolved = "scriptRes:Unknown host:"
const statusOk          = "scriptRes:Ok:"
const statusBad         = "scriptRes:Bad:"
const statusBadContents = "scriptRes:Bad contents:"

dim objArgs, strComputer, objWMIService, colSettings, objOperatingSystem, freemem, limit
Set objArgs = WScript.Arguments

if objArgs.Count>0 then
  limit = int(objArgs(0))
  strComputer = "."

  Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  Set colSettings = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")

  For Each objOperatingSystem in colSettings 
     'WScript.StdOut.WriteLine "Available Physical Memory: " & objOperatingSystem.FreePhysicalMemory
     'WScript.StdOut.WriteLine "Total Physical Memory: " & objOperatingSystem.TotalVisibleMemorySize
     'WScript.StdOut.WriteLine "Free percentage: " & round(objOperatingSystem.FreePhysicalMemory/objOperatingSystem.TotalVisibleMemorySize*100)
     freemem = round(objOperatingSystem.FreePhysicalMemory/objOperatingSystem.TotalVisibleMemorySize*100)
     IF freemem<limit THEN
        WScript.StdOut.WriteLine statusBad & freemem
     ELSE
        WScript.StdOut.WriteLine statusOk & freemem
     END IF
     EXIT FOR
  Next
ELSE
 WScript.StdOut.WriteLine statusUnknown & "Not enough parameters specified" 
END IF
Regards
Alex
Post Reply