Jump to content

Recommended Posts

Posted

I came across a script on the web which displays the free ram of a computer which i want to use with bginfo

but it doesn't work and I tried but im not great with WMI/VBS, can someone please help

 

Set winmgt = "winmgmts:{impersonationLevel=impersonate}!//"
Set WMI_Query = GetObject(winmgt).InstancesOf('Win32_OperatingSystem')
For Each Item in WMI_Query
FreeRam = Item.FreePhysicalMemory
Next
FreeRam = Round(FreeRam/(1024))
Echo “” & FreeRam & ” MB”

Posted (edited)

Can't help with the script (though this bump might catch someone's eye).

 

Is this just for you, to show people how much free RAM they have, or for extra info on a pre-existing BGinfo setup for multiple users?

Edited by LeMarchand
Posted

I'm not sure what benefit you will get from looking at 'Free RAM'. If you have roughtly the 'right' amount of physical ram in your computer and its been in use for a while, 'free ram' will always be quite low (hundreds of megs at most, and often almost none) since Windows uses any RAM not hosting executing code or working data, as a cache for file access.

 

The more useful metric is 'available' memory. This is roughly 'free ram + the cache'. If more working data/applications need to be loaded Windows will flush items out of the cache, mark them as free, and then allocate them to the required apps/data. If Available RAM is almost none then you have some problems.

 

This script might help, though I suspect it may be where you started: https://stackoverflow.com/questions/11343190/how-to-check-available-memory-ram-via-batch-script.

  • Thanks 1
Posted

BGInfo does have a place where you can create the variables that you wan to include on the desktop overlay.

The problem would be the free ram would be out of date as soon as its on the screen.

Posted

+1 this, its essentially a tattoo at the point in time BGInfo is run, its great for static (ish) data, AssetTag, IP Address, etc... but anything like performance stats, its a waste of time.

 

What is it you are trying to achieve, on a desktop PC, free RAM is not really a metric of much use. Yes its nice to say "I have 3.6GB available" but what I would focus on is a problem (assuming you have one). Id the machine running slow and you think RAM is the issue?

 

Advice I try to stick to - Fix the problem, not the numbers.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...