|
GooglePerformanceTools
Home page for Google Performance Tools
Google Performance ToolsThe fastest malloc we've seen; works particularly well with threads and STL. Also: thread-friendly heap-checker, heap-profiler, and cpu-profiler. OverviewPerf Tools is a collection of a high-performance multi-threaded malloc() implementation, plus some pretty nifty performance analysis tools. Perf Tools is distributed under the terms of the BSD License. For downloads, news, and other information, visit our Project Page. ExampleNote: this is by no means complete documentation, but simply gives you an idea of what the API is like. No recompilation is necessary to use these tools. TC Malloc: gcc [...] -ltcmalloc Heap Checker: gcc [...] -o myprogram -ltcmalloc HEAPCHECK=normal ./myprogram Heap Profiler: gcc [...] -o myprogram -ltcmalloc HEAPPROFILE=/tmp/netheap ./myprogram Cpu Profiler: gcc [...] -o myprogram -lprofiler CPUPROFILE=/tmp/profile ./myprogram Sample OutputThe heap profiler can pop up a window that displays information as a directed graph:
The cpu profiler can produce a weighted call graph:
DocumentationDownloadsFor downloads, please visit our Downloads Page. News
Links to Other SitesRuss Cox's gperftools-httpd, a simple http server based on thttpd that enables remote profiling via google-perftool's pprof. Brett Viren's Perftools project at the Brookhaven National Laboratory -- a similar project with the same name as Google's. [docs], [download] |
Sign in to add a comment
Works pretty well, and very simple to use. If one doesn't use valgrind, this should be used :)
Good work guys.
I wonder what the performance of the memory allocator is like, compared to the Hoard memory allocator. Has there been a comparison or benchmark?
Really cool. Much more help full than using gcc -pg. And the concept of being able enabling this on demand is superb.
Awesome tool and library! This has taken guesswork and speculation out of my profiling needs besides the great performance.
Why not expose other parts of the implementation also as an API (via installed header files)\? For example, I found SpinLock? to be highly performant and useful for my other needs. I suppose there are other efficient spin lock implementations out there that I could use, but since I already link against tcmalloc, it makes sense for me to just use this.
All this needs is to include spinlock.h in the installed header files under PREFIX/include/google
Very impressive. We have used the CPU profiler, heap checker and tcmalloc with our MySQL builds (at Google). The next MySQL patch distributed by Google will have changes so that it can optionally build with support for each of these. We replaced a custom memory heap in InnoDB with tcmalloc and that made it much faster. Numbers will be released soon. All of this has made our debugging work easier and our servers run faster.
Great malloc replacement for servers. Beware of the huge start time though. It takes 2-3 seconds for any program linked with tcmalloc just to get to the main function. It's like starting a jvm :)
I don't see an answer to yaserzt from over a month ago. How does it compare to Hoard? How does it compare to Miser?
How is the custom built of MySQL going on? I would really be interested in seeing those results.
On AIX 5.3 i get on executing configure checking how to access the program counter from a struct ucontext... configure: WARNING: Could not find the PC. Will not try to compile libprofiler... Is it possible to access the program counter (PC) on AIX 5.3 and if so how?
TCMalloc doubled the throughput for sysbench on MySQL because malloc is a hot spot.
Important: centos 5.3 64 bit. You gotsta compile tcmalloc from the tarball. Then for a mysqld build do:
According to the tcmalloc docs, you can set LD_PRELOAD and avoid having to rebuild a binary (like mysql) from source. What's the advantage of rebuilding mysql?
The links to documentation are pretty scarce here http://goog-perftools.sourceforge.net/doc/tcmalloc.html
ERROR when compiling it
$ make check source='src/tcmalloc.cc' object='libtcmalloc_minimal_la-tcmalloc.lo' libtool=yes \ DEPDIR=.deps depmode=gcc /bin/sh ./depcomp \ /bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I./src -I./src -DNO_TCMALLOC_SAMPLES -pthread -DNDEBUG -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -g -O2 -c -o libtcmalloc_minimal_la-tcmalloc.lo test -f 'src/tcmalloc.cc' || echo './'src/tcmalloc.cc
In file included from src/tcmalloc.cc:116: src/base/spinlock.h:70: macro `EXCLUSIVE_LOCK_FUNCTION' used without args src/base/spinlock.h:90: macro `UNLOCK_FUNCTION' used without args src/base/spinlock.h:147: macro `UNLOCK_FUNCTION' used without args make: libtcmalloc_minimal_la-tcmalloc.lo? Error 1please help me in fixing this ERROR