Featured post
c++ - Help with strange memory behavior. Looking for leaks both in my brain and in my code -
i spent last few days trying find memory leaks in program developing.
first of all, tried using leak detectors. after fixing few issues, not find leaks more. however, monitoring application using perfmon.exe
. performance monitor reports 'private bytes' , 'working set - private' steadily rising when app used. me, suggests program using more , more memory longer runs. internal resources seem stable however, sounds leaking me.
the program loading dll @ runtime. suspect these leaks or whatever occur in library , purged when library unloaded, hence won't picked leak detectors. used both devpartner boundschecker , virtual leak detector memory leaks. both supposedly catch leaks in dlls.
also, memory consumption increasing in steps , steps roughly, not exactly, coincide gui actions perform in application. if these errors in our code, should triggered every single time actions performed , not most of time.
whenever confronted strangeness, begin question basic assumptions. turn you, know everything, suggestions. there flaw in assumptions? have idea of how go troubleshooting problem this?
edit:
using microsoft visual c++ (x86) on windows 7 64.
edit2:
used ibm purify hunt leaks. first of all, lists full 30% of program leaked memory. can not true. guess identifying whole dll leaked or that. however, if search new leaks every few actions, reports leaks correspond size increase reported performance monitor. lead leak. sadly, using trial version of purify, won't show me actual location of leaks. (these leaks show @ runtime. when program exits, there no leaks whatsoever reported tool.)
monitoring app's memory use perfmon or task manager not valid way of checking memory leaks. example, runtime may holding on memory os pre-allocation purposes or due fragmentation.
the trick, in experience, crt debug heap. can request information live objects, , crt provides functions compare snapshots.
- Get link
- X
- Other Apps
Comments
Post a Comment