Link to home
Start Free TrialLog in
Avatar of JDEE8297
JDEE8297Flag for United States of America

asked on

How do you get the available memory on a web server?

I want to be able to get the available memory on a web server, by going to the page in asp.net and displaying the value. I want to be able to test under WindowsXP before moving it to production, so any help on this would be appreciated. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of daveamour
daveamour
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JDEE8297

ASKER

that should work, not totally familiar with csharp, but should be able to convert this to vb.net
Ok good luck
thank you again.
This was my conversion

 Dim ram As New System.Diagnostics.PerformanceCounter("Memory", "Available MBytes")
        dim cpu as New System.Diagnostics.PerformanceCounter()

        cpu.CategoryName = "Processor"
        cpu.CounterName = "% Processor Time"
        cpu.InstanceName = "_Total"
        Response.Write("Server Name - " & Environment.MachineName)
        Response.Write("<br>")
        Response.Write("Memory available - " & ram.NextValue().ToString & " Mb")
        Response.Write("<br>")
        response.Write ("CPU Used - " & cpu.NextValue().ToString & " %")

Thanks again for your help.
Looks nice and easy, nice one.