I have a need to monitor available memory while my application is running, as a hard number and compared to available memory. How can I do this?
Printable View
I have a need to monitor available memory while my application is running, as a hard number and compared to available memory. How can I do this?
How about My.Computer.Info.AvailableVirtualMemory and My.Computer.Info.AvailablePhysicalMemory?
And then use Math.Round to round it up and divide it by 1024 3 times to get GBs. This is assumnig every PC your application will interact with will have at least 1 GB memory. This is probably a safe assumption :)
Dave, that worked fine. Thanks for the reference.
No, the information isn't for display.
I have a multi-threaded application that is running into problems... I get an "out of memory" exception. So I needed a way to track the memory usages so I can see when and where it starts to spiral out of control.
In this instance, human readable in GB chunks is a drawback, not a benefit... more granularity in the raw numbers.