Jump to content

Find System's Total Ram


Recommended Posts

I'm all for this one. I've asked the question before.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Developers

this is what I use at the moment.....

; memory.exe ==> http://www.jsiinc.com/SUBB/tip0900/rh0985.htm
fileinstall("memory.exe", EnvGet("TEMP") & "\memory.exe")
runwait(@comspec & " /c " & EnvGet("TEMP") & "\memory.exe >mem.txt", EnvGet("TEMP"),@sw_hide)
$mem = filereadline(EnvGet("TEMP") & "\mem.txt")
if @error = 0 then
  msgbox(0,"mem",$mem)
endif 
filedelete(EnvGet("TEMP") & "\memory.exe")
filedelete(EnvGet("TEMP") & "\mem.txt")

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

this is what I use at the moment.....

; memory.exe ==> http://www.jsiinc.com/SUBB/tip0900/rh0985.htm
fileinstall("memory.exe", EnvGet("TEMP") & "\memory.exe")
runwait(@comspec & " /c " & EnvGet("TEMP") & "\memory.exe >mem.txt", EnvGet("TEMP"),@sw_hide)
$mem = filereadline(EnvGet("TEMP") & "\mem.txt")
if @error = 0 then
  msgbox(0,"mem",$mem)
endif 
filedelete(EnvGet("TEMP") & "\memory.exe")
filedelete(EnvGet("TEMP") & "\mem.txt")
Perhaps you wrote that a while back? I think I would be replacing

EnvGet("TEMP") with @TempDir. :whistle:

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Developers

Perhaps you wrote that a while back?  I think I would be replacing

EnvGet("TEMP") with @TempDir.  :whistle:

I believe it was at least yesterday!!! .. can't keep up with the new features that are rolled out each day !!! B)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I don't like the idea of using outside programs...

just quickly open the system properties (SYSDM.CPL) in SW_HIDE or SW_MINIMIZE form.

Then read Static15 (or whichever it may be) and then close it. You can even quickly read in all the Static fields and see which one has "KB RAM" in it. Should take less than half a second.

[quote]I was busy waiting all night for the Columbus Day Bunny to come down my chimney and light fireworks in my pumpkin.There's so much wrong with that.Oh, I'm sorry, i forgot you were Jewish.[/quote]

Link to comment
Share on other sites

I used to just use the mem dos command on win9X but it doesn't give you the same information on Windows2000 or XP. I agree that Autoit should have this built in, but the file memory.exe (That JdeB posted) does work wonderfully using FileInstall and FileDelete. :whistle:

We have enough youth. How about a fountain of SMART?

Link to comment
Share on other sites

Thanks Larry, I'll take a look at that, I've been needing to write something to get the total RAM for another small project, but I didn't know where in the API to do it.

Hahah at your signature, by the way, I started to suggest you should make it your signature on the forum when I read that on the list, but then I decided you would probably have already changed it before I could get the email since to the list anyway.

Link to comment
Share on other sites

That structure has some pretty neat stuff. It has:

MemoryLoad (Percentage of memory in use)

Total physical RAM

Available physical RAM

Total Pagefile

Available Pagefile

Total virtual

Available virtual

How does a function sound? Something that either returns an array filled with the information above, or the function takes a flag argument and returns whichever 1 of the above is associated with that flag. Now that we actually know what to use, this is very simple to implement.

Link to comment
Share on other sites

I also like the idea of a function or array.

Next question:  What about CPU speed/type?

Well, I suppose EnvGet("PROCESSOR_IDENTIFIER") works okay for CPU type.

I just finished GetMemoryStats() which returns a 7 element array containing all the items I listed above. I need to write the docs on it now, then send it to Jon.

The processor type/speed is another of the things I needed for my small project (Not AutoIt-related). I thought I had written some rough code to get those, but I don't see it so maybe I just looked at the API for it and nothing more. I'll take a look and see how much trouble that is and if it's not too bad, I'll submit something along with GetMemoryStats().

Link to comment
Share on other sites

There is also an external program for this called "chkcpu.exe".  It returns as much or as little information you need about the processor.

CPU Identification Utility

It.s hit and miss. I use it once in a while but I would rather see a function to do it. You can also often read it from the registry.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

for CPU speed... I dunno what systems... but mine is at...

HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\~MHZ

Thanks--I never new that! Works on XP at least.

Edit: What about laptops that could change their cpu speed? I assume the registry key refers to max speed (or basline speed when Windows was last booted) instead of current speed.

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

for CPU speed... I dunno what systems... but mine is at...

HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\~MHZ

The sytem memory information appears to reside within the following registry key/value:

HKEY_LOCAL_MACHINE\HARDWARE\RESOURCEMAP\System Resources\Physical Memory\.Translated

I haven't been able to find any supporting documentation on this; but it appears that this string contains the offsets for the processor cache, as well as any SIMM/DIMM bays with installed chips.

If this is true, then there should be a way to use these offsets to calculate how much physical memory exists on the system. Unfortunately I've not found a way to reliably translate these values (yet). :whistle:

Link to comment
Share on other sites

The sytem memory information appears to reside within the following registry key/value:

HKEY_LOCAL_MACHINE\HARDWARE\RESOURCEMAP\System Resources\Physical Memory\.Translated
And that key only appears on XP and maybe Win 2000 systems. It does not appear with 9x systems.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...