What's new? | Help | Directory | Sign in
Google
google-perftools
Fast, multi-threaded malloc() and nifty performance analysis tools
  
  
  
  
    
Search
for
Updated Jun 05, 2007 by csilvers
GooglePerformanceTools  
Home page for Google Performance Tools

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

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]


Comment by david.coallier, Aug 29, 2007

Works pretty well, and very simple to use. If one doesn't use valgrind, this should be used :)

Good work guys.

Comment by yaserzt, Nov 27, 2007

I wonder what the performance of the memory allocator is like, compared to the Hoard memory allocator. Has there been a comparison or benchmark?

Comment by maximus.ka, Nov 29, 2007

Really cool. Much more help full than using gcc -pg. And the concept of being able enabling this on demand is superb.

Comment by shashibg, Feb 19, 2008

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

Comment by mdcallag, Jun 10, 2008

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.

Comment by vicaya, Jun 24, 2008

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 :)


Sign in to add a comment