I apologize in advance for asking a question that might be a little more specific and not a general concept type question.
Using Visual Studio 2010, Visual C#, .NET 3.5, DevExpress 11.1
We have a little application running on three separate Windows XP Embedded “Panel PC’s” mounted in electrical distribution boxes, each installed in a remote building. The application communicates with a central database to display important events in a tabled view, polling every second as to be as up to date as possible.
I started the application on each last week Monday. On a small device like that the CPU usage float around 5 – 10% and the memory usage started as 25 – 30MB. Today, a week later, the memory usage sits at 80MB – I was monitoring it during last week and it kept increasing.
As far as I know I have made effort to dispose all disposable objects using ‘using’ statements wherever possible. I don’t know how else to release memory. If it starts at 30MB, shouldn’t it remain there?
I have though about restarting the application every week or so, but XPE don’t have the ‘taskkill’ command; nor does it have the ‘shutdown’ command so rebooting weekly is also not an option. Seems I’ll have to really optimize my code.
So I suppose what I would like to know: What are GREAT ways to conserve memory on a device with very limited resources such as a panel PC / thin client and where restarting applications and devices can’t be automated?
Thanx.
Use a memory profiler. There is an allocation profiler built into VS 2010, and there are plenty of third party profiles such as ANTS. On a snapshot of your heap you can see which objects are lingering.
Using VS2010 Profiler for memory measurement