Windows 7 memory leak
-
Wednesday, April 25, 2012 2:22 PM
We had a legacy, C# Framework 2.0 application running on a Windows 7 64 bit PC and we started experiencing a linear memory leak that would hang the computer in 2-3 days.
We used some tools to troubleshoot the leak and it pointed us out to the System.MemoryStream, perhaps used in some graphic interfaces. We still haven't solved the leak, but I'm curious why it became an issue on the Windows 7 64 PCs.
The same application runs pretty stable in XP machines for weeks without any memory issues.
Any ideas?
Thanks
Alex
All Replies
-
Wednesday, April 25, 2012 2:33 PM
... perhaps used in some graphic interfaces. ...
It's an allergic reaction from me: Do you create Windows-Forms-GDI-Objects, like for example bitmaps? Are you going to dispose them manually/correctly? If not, the garbage colector will not clean up them! -
Thursday, April 26, 2012 3:46 PM
Thank you for your suggestion,
Yes there are plenty of animations and... I'm not sure if I dispose them "correctly", because GC is an entity I will never fully understand and trust.
But I do implement IDisposable and release both manage and unmanaged resources along my code following MS best practices, and really never had any memory issues before porting my app to Windows 7.
After three days of troubleshooting I gave up, something kept telling me it was a platform incompatibility issue. So as a last resort I tried compiling my application in 32 bits (instead of "Any" platform), forcing Windows 7 to run it as 32 instead of 64, and bingo that took care of the problem, the memory leak is gone.
So I guess there is something rotten in Denmark with GC, legacy applications and Windows 7 64.
Alex
- Marked As Answer by Bob ShenMicrosoft Contingent Staff, Moderator Tuesday, May 01, 2012 6:52 AM

