View previous topic :: View next topic |
Author |
Message |
nasdo AG
Joined: 16 Sep 2009 Posts: 14
|
Posted: Mon Nov 16, 2009 5:16 am Post subject: Who to make a RAM Test ? |
|
|
I want to test my RAM usage, who can I create the test for this.? |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Mon Nov 16, 2009 11:05 am Post subject: |
|
|
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/mframe.htm#tests.htm#wmi
http://www.ks-soft.net/hostmon.eng/mframe.htm#tests.htm#perfcounter
Regards
Alex |
|
Back to top |
|
|
psharp
Joined: 02 Jul 2010 Posts: 3
|
Posted: Fri Jul 02, 2010 2:55 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Fri Jul 02, 2010 3:12 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
psharp
Joined: 02 Jul 2010 Posts: 3
|
Posted: Fri Jul 02, 2010 3:16 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Fri Jul 02, 2010 3:42 pm Post subject: |
|
|
It matches what Task Manager shows on my system
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 |
|
Back to top |
|
|
psharp
Joined: 02 Jul 2010 Posts: 3
|
Posted: Tue Jul 06, 2010 2:54 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Wed Jul 07, 2010 8:16 am Post subject: |
|
|
Then may be Task Manager uses TotalVisibleMemorySize and FreePhysicalMemory counters provided by Win32_OperatingSystem class
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/mframe.htm#tests.htm#chkShell
Regards
Alex |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Wed Jul 07, 2010 8:44 am Post subject: |
|
|
PS
You may use script like this
Code: | '-----------------------------------------------------------------------
'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 |
|
Back to top |
|
|
|