简体   繁体   中英

Compact framework AppVerifier and managed code. Lots of memory leaks found?

I'm trying to find an unmanaged memory leak in my mobile project. I read that I should try and use AppVerifier to help find where the leak is. After running the program, I got a log that was +5mb! It had so much data that I don't even know how to begin looking for where the problem is. I tried searching for my application in the log, but none of my methods are found. Almost all the leaks happen within mscoree3_5.dll

I make some P/Invokes, use Brushes, Fonts, Pens, Bitmaps, IImages (and other Imaging API stuff) but all of them can be traced (as far as I can tell) to a using or a .Dispose() . I might be mistaken in this assumption, but I don't know how to tell! FxCop doesn't find any items that aren't disposed of, and everytime I read through the code, I can't find any either.

My question is, what is the easiest way to find where objects that can be disposed of but aren't, or unmanaged memory is not being cleared from within managed code? Also, what all needs to be released, disposed of, or whatever in the Imaging APIs (IImage interface, IImageFactory, etc)

Thank you for any help!

AppVerifier is a native app tool and will do you no good. You need to use the CLR Profiler and Remote Performance Monitor .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM