diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 21:17:51 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 21:17:51 +0000 |
commit | 0c6854514bc0c543d63f8cbac07360c5c0885592 (patch) | |
tree | 02411257153034e09411cfae68da0121a8019cab /tools/memory_watcher/dllmain.cc | |
parent | 7fd41a837aef6af92487dccfcc2819e3de8c6e41 (diff) | |
download | chromium_src-0c6854514bc0c543d63f8cbac07360c5c0885592.zip chromium_src-0c6854514bc0c543d63f8cbac07360c5c0885592.tar.gz chromium_src-0c6854514bc0c543d63f8cbac07360c5c0885592.tar.bz2 |
Support running memory watch under vista, plus other tweaks
This version of memory_watcher can run under Vista, even though the
recursive calls that it handles are appearing often enough that there
is a performance penalty. With this landed, it may be possible for other
folks to run the tool, and I can work on improving its performance.
This CL also resolves the problem with hanging processes. Although
memory reporting can only be done once, and it leaves a pile of memory
"hanging around," the browser can be cleanly exited.
Tweaks include outputing the aggregate stacks such that the largest
stacks appear at the start of the output file.
This version avoids ongoing aggregation of stats in favor of only
doing the aggregation at dump-time. This probably enhances performance
at run-time, although it is hidden (on Vista) by the recursive calling.
This also simplifies the tracking code a fair amount.
There is some evidence that a small number of duplicate calls are being
made to "track" the same memory region, without an intervening free (i.e.,
call to "untrack"). The code to better diagnose this is currently in
place, but ifdef'ed, as it is only useful under a debugger. Exercise
of this code (turning a stack-frame list into a human readable stack
trace string) currently causes some corruption shortly after it triggers,
so I can't leave it on full time.
r=mbelshe
Review URL: http://codereview.chromium.org/366031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31299 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/memory_watcher/dllmain.cc')
-rw-r--r-- | tools/memory_watcher/dllmain.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/memory_watcher/dllmain.cc b/tools/memory_watcher/dllmain.cc index a7d69f4..f60ce8b 100644 --- a/tools/memory_watcher/dllmain.cc +++ b/tools/memory_watcher/dllmain.cc @@ -60,9 +60,8 @@ DWORD WINAPI ThreadMain(LPVOID) { case WAIT_OBJECT_0: if (g_memory_watcher) { g_memory_watcher->DumpLeaks(); - // After dumping, we teardown. - ExitProcess(0); } + stopping = true; break; case WAIT_OBJECT_0 + 1: stopping = true; |