Getting the total and free amount of RAM

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
 
A

Alex Clark

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
 
C

Cor Ligthert

Robin,

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

Cor
 
C

Cor Ligthert

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
 
I

Imran Koradia

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top