سؤال

Does anyone have an idea how Application Verifier works?

I am currently working on a tree parsing application, which heavily uses recursion. The program seems to work as intended, however I do use "new" in a few places, so I thought of checking for memory leaks with Application Verifier. AV doesn't report any errors, however, in a couple of minutes the image of the application quickly grows to about a gigabyte, whereas without it only got to around 60 megs. I can't seem to find any memory leaks, and seeing how much recursion is going on, I am starting to suspect that AV places extra items on the stack for testing purposes, and as the recursion goes deeper the extra "junk" builds up and crashes the program.

Does anyone have any insight into the matter?

هل كانت مفيدة؟

المحلول

It may depend which AppVerifier features you've turned on. There's a heap checking feature that puts each allocation in its own page and allocates guard pages between allocations. If you're allocating lots of small objects, this feature will dramatically increase memory usage. This is normal behavior for this kind of testing and not something to worry about.

Off hand, I don't know of any features that affect stack usage. I believe it would be difficult to mess with the stack without recompiling the code with instrumentation, and AppVerifier doesn't require compiling with instrumentation.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top