KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Who to make a RAM Test ?

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
nasdo AG



Joined: 16 Sep 2009
Posts: 14

PostPosted: Mon Nov 16, 2009 5:16 am    Post subject: Who to make a RAM Test ? Reply with quote

I want to test my RAM usage, who can I create the test for this.?
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Mon Nov 16, 2009 11:05 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
psharp



Joined: 02 Jul 2010
Posts: 3

PostPosted: Fri Jul 02, 2010 2:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Fri Jul 02, 2010 3:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
psharp



Joined: 02 Jul 2010
Posts: 3

PostPosted: Fri Jul 02, 2010 3:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Fri Jul 02, 2010 3:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
psharp



Joined: 02 Jul 2010
Posts: 3

PostPosted: Tue Jul 06, 2010 2:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Wed Jul 07, 2010 8:16 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Wed Jul 07, 2010 8:44 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index