Update: Memory usage reporting fixed in Analog PC Stats application

I no longer maintain this project here, please visit the new website for it to download the updated software:


Thanks! -Scott.

Updated PC Meter application

It was brought to my attention a couple months ago by mnedix that the application I developed for the Analog PC Stats Meter was not reporting the correction Memory usage. I looked into it, and it turns out that the PerformanceCounter I was using in C# ties into the page file, not just physical memory. Apparently it was close enough to the physical memory used when I tested the program initially, because I never caught it. I just released an updated version of the application today that get the actual physical memory percentage used (you can download it here). It utilizes the GetPerformanceInfo Windows API to do this, using code developed by Antonio Bakula. This post at Stack Overflow is what led me to his solution. As the screenshot above shows, it’s now very close to what Windows reports. It’s a little off, maybe due to rounding, I didn’t have a lot of time to dig deeper. It’s close enough, at least for me! In the screenshot, I’ve got a couple textboxes that display physical available memory and total physical memory for troubleshooting.

While I’m posting, I want to point out it’s been approximately a year since I last posted on my blog, but I’m still here. The last year-and-a-half has been quite hectic for me, but I hope to get back into working on projects and sharing them on here soon! I’ve heard from a few people who have enjoyed my posts and used the information I’ve shared to work on their own projects and it’s been great hearing from them. Thanks!

19 thoughts to “Update: Memory usage reporting fixed in Analog PC Stats application”

    1. Juri, thanks for the feedback! I’ve seen this problem when shutting down the computer, as is explained in the original post for this project. Is this the issue you’re seeing? I haven’t had it hang any other time.

        1. That’s something I haven’t tested. I have it running on my work PC, which is always on. I imagine it’s the same issue though. Unfortunately, I don’t have time to address it right now, but I’ll see if I can in the coming months. I’m sorry it’s causing you trouble, but thank you for reporting it!

    1. Thanks Jason! Sorry it’s taken me so long to reply. CPU temp would be very cool! I hope someday to revisit this project with a nicer-looking meter and some updates to the software. When I do, I may consider adding some other options, it’s a project I really loved and I hope to work on more in the future!

  1. One other thing. In windows 10 this program will stop the OS from shutting down. I did a little digging and I changed a line of your code that seems to fix this.

    I changed “if ((exitApp)”

    to “if ((exitApp) || (e.CloseReason == CloseReason.WindowsShutDown))”

    I know so very little about programming but I think this did the trick.

    1. Thanks for sharing that – unfortunately the program does this on all versions of Windows, due to a problem with how I did things vs. how C# handles them. I’ll look into your suggestion when I get around to working on it again!

    1. Hey Paul, that looks great! Love it! I especially dig the LEDs integrated with the meters. I get more feedback on this project than any other, so I do hope to go back and fix the program to address some of the issues and build another meter. I’ll be sure to let you know when I do. Thanks for taking the time to share your build, enjoy it!

Leave a Reply

Your email address will not be published. Required fields are marked *