Getting the total and free amount of RAM

  • Thread starter Thread starter RobinSword
  • Start date Start date
R

RobinSword

Hi there!

I want my VB.NET-program to determine the total amount and free amount
of RAM (system memory).
How can I do that? I suppose with WMI, but I don't know which "tables"
to query...

Can anybody help me??

Thanks!
RobinSword
 
Check out System.Environment, I think there's something in there.
Alternatively, there might be something exposed by the Garbage Collector
IIRC.

Cheers,
Alex



RobinSword said:
Hi there!

I want my VB.NET-program to determine the total amount and free amount
of RAM (system memory).
How can I do that? I suppose with WMI, but I don't know which "tables"
to query...

Can anybody help me??

Thanks!
RobinSword
 
Robin,

It is "PhysicalMemory" inside WMI (win32), from your message I understood
that you know how to get it.

Cor
 
Robin.

Forget my answer I readed it wrong I see now from the answer from Alex..

And because the free amount is never the same, I ignore for ever any
interest in reading those messages or documentation.

Sorry

Cor
 
you could also try using the performance counter component.
Select the 'Components' section from the Toolbox and use the 'Performace
Counter' component. Set the CategoryName to 'Memory' and the CounterName
to 'Available MBytes'. I haven't tried using this counter but it should work.
You'll still have to refresh every so often to get the latest stats.

hope that helps..
Imran.
 
Back
Top