in reply to Available RAM in Win32?

I browsed through the registry, and there doesn't *seem* to be an entry that indicates how much physical memory is installed in the machine.

However, you could use the GlobalMemoryStatus and GlobalMemoryStatusEx functions that will return the free and used values of the amount of physically installed memory, the paging file size, the virtual memory size, and a general 'best guess' utilization expressed as a percentage. This information is in the MSDN, and can be searched for at msdn.microsoft.com, or, if you have trouble with that, I can cut-n-paste the pages to e-mail for you.

GlobalMemoryStatus will work on any Windows 3.1 and up machine, while GlobalMemoryStatusEx requires Windows-95 and up.

This might be a good module to write and submit to CPAN as part of the Win32 services...

--Chris

e-mail jcwren

Replies are listed 'Best First'.
RE: (Guildenstern) RE: Available RAM in Win32?
by Guildenstern (Deacon) on Sep 01, 2000 at 18:07 UTC
    GlobalMemoryStatus is the one I was looking for. According to the online documentation, GlobalMemoryStatusEx is only supported on Windows 2000.
    I have written a small module available over at Win32::MemoryInfo. It almost cries out to have something else added to it before I submit it, though. I noticed a function called GetSystemInfo which will return processor information that might be a nice inclusion.

    Guildenstern
    Negaterd character class uber alles!