|
|
Google Performance Tools
The fastest malloc we've seen; works particularly well with threads and STL. Also: thread-friendly heap-checker, heap-profiler, and cpu-profiler.
Overview
Perf 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.
Example
Note: 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 Output
The heap profiler can pop up a window that displays information as a directed graph:
The cpu profiler can produce a weighted call graph:
Documentation
Downloads
For downloads, please visit our Downloads Page.
News
- Version 0.91 released, Apr 2007
- Version 0.90 released, Apr 2007
- Version 0.8 released, Jun 2006
- Version 0.7 released, Apr 2006
- Version 0.6 released, Jan 2006
- Version 0.5 released, Nov 2005
- Version 0.4 released, Oct 2005
- Version 0.3 released, June 2005
- Initial Launch, March 2005
Links to Other Sites
Russ 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 :)