OLD | NEW |
1 IMPORTANT NOTE FOR 64-BIT USERS | 1 IMPORTANT NOTE FOR 64-BIT USERS |
2 ------------------------------- | 2 ------------------------------- |
3 There are known issues with some perftools functionality on x86_64 | 3 There are known issues with some perftools functionality on x86_64 |
4 systems. See 64-BIT ISSUES, below. | 4 systems. See 64-BIT ISSUES, below. |
5 | 5 |
6 | 6 |
7 TCMALLOC | 7 TCMALLOC |
8 -------- | 8 -------- |
9 Just link in -ltcmalloc or -ltcmalloc_minimal to get the advantages of | 9 Just link in -ltcmalloc or -ltcmalloc_minimal to get the advantages of |
10 tcmalloc -- a replacement for malloc and new. See below for some | 10 tcmalloc -- a replacement for malloc and new. See below for some |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 ___tls_get_addr: symbol not found | 197 ___tls_get_addr: symbol not found |
198 | 198 |
199 This means that you have a system where some parts are updated enough | 199 This means that you have a system where some parts are updated enough |
200 to support Thread Local Storage, but others are not. The perftools | 200 to support Thread Local Storage, but others are not. The perftools |
201 configure script can't always detect this kind of case, leading to | 201 configure script can't always detect this kind of case, leading to |
202 that error. To fix it, just comment out (or delete) the line | 202 that error. To fix it, just comment out (or delete) the line |
203 #define HAVE_TLS 1 | 203 #define HAVE_TLS 1 |
204 in your config.h file before building. | 204 in your config.h file before building. |
205 | 205 |
206 | 206 |
207 OS X ISSUES | |
208 ----------- | |
209 | |
210 You may need to set the environment variable DYLD_FORCE_FLAT_NAMESPACE | |
211 to use perftools with OS X. Because of how OS X does symbol binding, | |
212 libc routines will use libc malloc even when the binary is linked with | |
213 -ltcmalloc. This is not usually a problem, but becomes one if the | |
214 application is responsible for freeing that memory: the application | |
215 will use tcmalloc's free() to try to free memory allocated with libc's | |
216 malloc(), which will cause no end of confusion. | |
217 | |
218 One (or both) of these workaround may fix the problem: | |
219 DYLD_FORCE_FLAT_NAMESPACE=1 myapp | |
220 DYLD_INSERT_LIBRARIES=path/to/libtcmalloc.dylib myapp | |
221 | |
222 The best solution may depend on the version of OS X being used. | |
223 Neither solution is likely to work if you dlopen() libraries from | |
224 within your application. If you have any experience with this, we'd | |
225 appreciate you sharing it at | |
226 http://groups.google.com/group/google-perftools | |
227 | |
228 | |
229 64-BIT ISSUES | 207 64-BIT ISSUES |
230 ------------- | 208 ------------- |
231 | 209 |
232 There are two issues that can cause program hangs or crashes on x86_64 | 210 There are two issues that can cause program hangs or crashes on x86_64 |
233 64-bit systems, which use the libunwind library to get stack-traces. | 211 64-bit systems, which use the libunwind library to get stack-traces. |
234 Neither issue should affect the core tcmalloc library; they both | 212 Neither issue should affect the core tcmalloc library; they both |
235 affect the perftools tools such as cpu-profiler, heap-checker, and | 213 affect the perftools tools such as cpu-profiler, heap-checker, and |
236 heap-profiler. | 214 heap-profiler. |
237 | 215 |
238 1) Some libc's -- at least glibc 2.4 on x86_64 -- have a bug where the | 216 1) Some libc's -- at least glibc 2.4 on x86_64 -- have a bug where the |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 your code, rather than setting CPUPROFILE. This will profile only | 256 your code, rather than setting CPUPROFILE. This will profile only |
279 those sections of the codebase. Though we haven't done much testing, | 257 those sections of the codebase. Though we haven't done much testing, |
280 in theory this should reduce the chance of crashes by limiting the | 258 in theory this should reduce the chance of crashes by limiting the |
281 signal generation to only a small part of the codebase. Ideally, you | 259 signal generation to only a small part of the codebase. Ideally, you |
282 would not use ProfilerStart()/ProfilerStop() around code that spawns | 260 would not use ProfilerStart()/ProfilerStop() around code that spawns |
283 new threads, or is otherwise likely to cause a call to | 261 new threads, or is otherwise likely to cause a call to |
284 pthread_mutex_lock! | 262 pthread_mutex_lock! |
285 | 263 |
286 --- | 264 --- |
287 17 May 2011 | 265 17 May 2011 |
OLD | NEW |