Update: Memory usage reporting fixed in Analog PC Stats application

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!

pc meter header

Analog PC Stats Meter

Intro

At some point while researching microcontroller projects, I came across several people who had used Arduinos and PICs to drive analog panel meters so they would display computer stats such as CPU load, memory usage, etc.  It immediately struck me as something I just had to do.  Here it is.  My PC meter uses an Arduino microcontroller and receives the stats from a .NET Framework application I wrote in C#.Net.  It’s housed in a plastic enclosure and looks quite professional IMHO.  It was a fun project, and something I think most any computer/electronics geek would enjoy.  I love mine, and I look forward to building more.

Here it is in action:

Read on for details on the parts and tools I used, some info on the process of building the device (and the problems I ran into) and links to download the source code and meter templates.

(more…)