OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <HTML> | 2 <HTML> |
3 | 3 |
4 <HEAD> | 4 <HEAD> |
5 <link rel="stylesheet" href="designstyle.css"> | 5 <link rel="stylesheet" href="designstyle.css"> |
6 <title>Google Heap Profiler</title> | 6 <title>Gperftools Heap Profiler</title> |
7 </HEAD> | 7 </HEAD> |
8 | 8 |
9 <BODY> | 9 <BODY> |
10 | 10 |
11 <p align=right> | 11 <p align=right> |
12 <i>Last modified | 12 <i>Last modified |
13 <script type=text/javascript> | 13 <script type=text/javascript> |
14 var lm = new Date(document.lastModified); | 14 var lm = new Date(document.lastModified); |
15 document.write(lm.toDateString()); | 15 document.write(lm.toDateString()); |
16 </script></i> | 16 </script></i> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 <p>There are several alternatives to actually turn on heap profiling | 59 <p>There are several alternatives to actually turn on heap profiling |
60 for a given run of an executable:</p> | 60 for a given run of an executable:</p> |
61 | 61 |
62 <ol> | 62 <ol> |
63 <li> <p>Define the environment variable HEAPPROFILE to the filename | 63 <li> <p>Define the environment variable HEAPPROFILE to the filename |
64 to dump the profile to. For instance, to profile | 64 to dump the profile to. For instance, to profile |
65 <code>/usr/local/bin/my_binary_compiled_with_tcmalloc</code>:</p> | 65 <code>/usr/local/bin/my_binary_compiled_with_tcmalloc</code>:</p> |
66 <pre>% env HEAPPROFILE=/tmp/mybin.hprof /usr/local/bin/my_binary_compiled
_with_tcmalloc</pre> | 66 <pre>% env HEAPPROFILE=/tmp/mybin.hprof /usr/local/bin/my_binary_compiled
_with_tcmalloc</pre> |
67 <li> <p>In your code, bracket the code you want profiled in calls to | 67 <li> <p>In your code, bracket the code you want profiled in calls to |
68 <code>HeapProfilerStart()</code> and <code>HeapProfilerStop()</code>. | 68 <code>HeapProfilerStart()</code> and <code>HeapProfilerStop()</code>. |
69 (These functions are declared in <code><google/heap-profiler.h></co
de>.) | 69 (These functions are declared in <code><gperftools/heap-profiler.h>
</code>.) |
70 <code>HeapProfilerStart()</code> will take the | 70 <code>HeapProfilerStart()</code> will take the |
71 profile-filename-prefix as an argument. Then, as often as | 71 profile-filename-prefix as an argument. Then, as often as |
72 you'd like before calling <code>HeapProfilerStop()</code>, you | 72 you'd like before calling <code>HeapProfilerStop()</code>, you |
73 can use <code>HeapProfilerDump()</code> or | 73 can use <code>HeapProfilerDump()</code> or |
74 <code>GetHeapProfile()</code> to examine the profile. In case | 74 <code>GetHeapProfile()</code> to examine the profile. In case |
75 it's useful, <code>IsHeapProfilerRunning()</code> will tell you | 75 it's useful, <code>IsHeapProfilerRunning()</code> will tell you |
76 whether you've already called HeapProfilerStart() or not.</p> | 76 whether you've already called HeapProfilerStart() or not.</p> |
77 </ol> | 77 </ol> |
78 | 78 |
79 | 79 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 name, just set prepend <code>./</code> to your filename: | 364 name, just set prepend <code>./</code> to your filename: |
365 <code>HEAPPROFILE=./Ägypten</code>. | 365 <code>HEAPPROFILE=./Ägypten</code>. |
366 </ul> | 366 </ul> |
367 | 367 |
368 <hr> | 368 <hr> |
369 <address>Sanjay Ghemawat | 369 <address>Sanjay Ghemawat |
370 <!-- Created: Tue Dec 19 10:43:14 PST 2000 --> | 370 <!-- Created: Tue Dec 19 10:43:14 PST 2000 --> |
371 </address> | 371 </address> |
372 </body> | 372 </body> |
373 </html> | 373 </html> |
OLD | NEW |