summaryrefslogtreecommitdiff
path: root/src/malloc_extension.cc
Commit message (Collapse)AuthorAgeFilesLines
* * Suppress all large allocs when report threshold==0csilvers2010-11-181-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Clarified meaning of various malloc stats * Change from ATTRIBUTED_DEPRECATED to comments * Make array-size a var to compile under clang * Reduce page map key size under x86_64 by 4.4MB * Added full qualification to MemoryBarrier * Support systems that capitalize /proc weirdly * Avoid gcc warning: exporting type in unnamed ns * Add some dynamic annotations for gcc attributes * Add support for census profiler in pprof * Speed up pprof's ExtractSymbols * Speed up GoogleOnce * Add pkg-config (.pc) files * Detect when __environ exists but is NULL * Improve spinlock contention performance * Add GetFreeListSizes * Improve sampling_test, eg by adding no-inline * Relax malloc_extension test-check for big pages * Add proper library version number information * Update from autoconf 2.64 to 2.65 * Better document how to write a server that works with pprof * Change FillProcSelfMaps to better handle out-of-space * No longer hook _aligned_malloc/free in windows * Handle function-forwarding in DLLs when patching (in windows) * Update .vcproj files that had wrong .cc files in them (!) * get rid of unnecessary 'size < 0' * fix comments a bit in sysinfo.cc * another go at improving malloc-stats output * fix comment typo in profiler.cc * Add a few more thread annotations * Try to read TSC frequency from 'tsc_freq_khz' * Fix annotalysis/TSAN incompatibility * Add pprof --evince to go along with --gv * Document need for sampling to use GetHeapSample * Fix flakiness in malloc_extension_test * Separate out synchronization profiling routines git-svn-id: http://gperftools.googlecode.com/svn/trunk@99 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* * Add new (std::nothrow) to debugallocation (corrado)csilvers2010-03-231-1/+4
| | | | | | | | | | | | | | | | | | | | | * Add a flag to ingore unaligned-ptr leaks (archanakannan) * PORTING: Add get-pc capabilities for a new OS (csilvers) * Don't register malloc extension under valgrind (csilvers) * Fix throw specs for our global operator new (chandlerc) * PORTING: link to instructions on windows static overrides (mbelshe) * Fix prototype differences in debugalloc (chandlerc, csilvers, wan) * Change pprof to handle big-endian input files (csilvers) * Properly align allocation sizes on Windows (antonm) * Improve IsRunningOnValgrind, using valgrind.h (csilvers, kcc) * Improve the accuracy of system_alloc actual_size (csilvers) * Add interactive callgrind support to pprof (weidenri...) * Fix off-by-one problems when symbolizing in pprof (dpeng) * Be more permissive in allowed library names, in pprof (csilvers) * PORTING: Fix pc_from_ucontext to handle cygwin and redhat7 (csilvers) * Fix stacktrace to avoid inlining (ppluzhnikov) git-svn-id: http://gperftools.googlecode.com/svn/trunk@91 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* * Prefer __environ to /proc/self/environ (csilvers)csilvers2009-12-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * Add HEAP_CHECK_MAX_LEAKS envvar (glider) * BUGFIX: debugallocation now calls cpp_alloc for new (willchan) * BUGFIX: tc_set_new_mode() respected for realloc and calloc (willchan) * BUGFIX: fix opt-mode maybe-crash on debugallocation_test (csilvers) * Print alloc size when mmap fails (hakon) * Add ITIMER_REAL support (csilvers, nabeelmian) * BUGFIX: correctly report double-frees (csilvers) * Export tc_set_new_mode() from the .h file (willchan) * Restructure Symbolize to make it more efficient (glider) * PORTING: Augment sysinfo to work on 64-bit OS X (csilvers) * Add two numeric pageheap properties to MallocExtension (fikes) * PORTING: Use libunwind for i386 when using --omitfp (ppluzhnikov) * Add ReleaseToSystem(num_bytes) (kash) * Provide correct library filenames under solaris (jeffrey) * BUGFIX: simple fix in pprof --raw mode (mrabkin) * PORTING: Prefer sys/ucontext.h to fix OS 10.6 builds (csilvers) * Improve support for inlined functions in pprof (sanjay) * Update wget code to not use keepalive (mrabkin, csilvers) * PORTING: correctly handle x86_64 machines that use fp's (csilvers) git-svn-id: http://gperftools.googlecode.com/svn/trunk@79 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* * Replace usleep() and poll() with nanosleep() (glider)csilvers2009-11-101-1/+10
| | | | | | | | | | | | | | | | | | | | * Document problems with _recalloc (csilvers) * Detect when x86_64 doesn't turn off frame pointers (csilvers) * Fix sysinfo.cc/etc to work with 64-bit os x (csilvers) * BUGFIX: Use __TEXT instead of __DATA to store tcmalloc fns (csilvers) * Added two numeric pageheap properties to tcmalloc (fikes) * Support for mallocranges stats visualization (sanjay) * Use libunwind for i386, not just x86_64 (ppluzhnikov) * Add ReleaseToSystem(num_bytes) (kash) * Provide corect library filenames under solaris (jeffrey) * BUGFIX: a simple bug in pprof --raw mode (mrabkin) * Prfer sys/ucontext.h to ucontext.h, to fix OS X 10.6 (csilvers) * Improve supprot for inlined functions in pprof (sanjay) * Document inaccuracies in profiling mmap calls (csilvers) * Update wget code to not use keepalive (mrabkin, csilvers) git-svn-id: http://gperftools.googlecode.com/svn/trunk@78 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* * Fix Symbolize() to call pprof once, rather than once/symbol (glider)csilvers2009-10-271-11/+11
| | | | | | | | | | | | | | | | | | * Fix unsetting of hooks before forking, in debug mode (maxim) * Add some documention for pmuprofile (aruns) * Speed up futex with FUTEX_PRIVATE_FLAG (m3b) * Fix os x 10.6: prefer sys/ucontext.h to ucontext.h (csilvers) * Fix C shims to be actually valid C: malloc_extension/etc (csilvers) * Fix a longtime memset bug (csilvers) * Implement nothrow versions of delete (csilvers) * Fix recursively-unmapped-region accounting (ppluzhnikov) * Better distinguish between real and fake VDSO (ppluzhnikov) * Modify span coalescing to improve performance (sanjay) * WINDOWS: Remove unnecessary lock around VirtualAlloc (mbelshe) * Remove performance tests for ptmalloc2 (csilvers) git-svn-id: http://gperftools.googlecode.com/svn/trunk@77 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* Thu Sep 10 13:51:15 2009 Google Inc. <opensource@google.com>csilvers2009-09-111-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * google-perftools: version 1.4 release * Add debugallocation library, to catch memory leaks, stomping, etc * Add --raw mode to allow for delayed processing of pprof files * Use less memory when reading CPU profiles * New environment variables to control kernel-allocs (sbrk, memfs, etc) * Add MarkThreadBusy(): performance improvement * Remove static thread-cache-size code; all is dynamic now * Add new HiddenPointer class to heap checker * BUGFIX: pvalloc(0) allocates now (found by new debugalloc library) * BUGFIX: valloc test (not implementation) no longer overruns memory * BUGFIX: GetHeapProfile no longer deadlocks * BUGFIX: Support unmapping memory regions before main * BUGFIX: Fix some malloc-stats formatting * BUGFIX: Don't crash as often when freeing libc-allocated memory * BUGFIX: Deal better with incorrect PPROF_PATH when symbolizing * BUGFIX: weaken new/delete/etc in addition to malloc/free/etc * BUGFIX: Fix return value of GetAllocatedSize * PORTING: Fix mmap-#define problem on some 64-bit systems * PORTING: Call ranlib again (some OS X versions need it) * PORTING: Fix a leak when building with LLVM * PORTING: Remove some unneeded bash-ishs from testing scripts * WINDOWS: Support library unloading as well as loading * WINDOWS/BUGFIX: Set page to 'xrw' instead of 'rw' when patching git-svn-id: http://gperftools.googlecode.com/svn/trunk@76 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* 1) Change #include "config.h" to <config.h>. This is what automakecsilvers2009-04-211-1/+1
| | | | | | | | | | recommends, and makes it easier to override a config file. 2) Rename OS_WINDOWS in sysinfo.cc, to not conflict with a macro defined in a windows SDK somewhere. git-svn-id: http://gperftools.googlecode.com/svn/trunk@70 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* Wed Mar 11 11:25:34 2009 Google Inc. <opensource@google.com>csilvers2009-03-111-95/+52
| | | | | | | | | | | | | | | | | | | | | | * google-perftools: version 1.1 release * Dynamically resize thread caches -- nice perf. improvement (kash) * Add VDSO support to give better stacktraces in linux (ppluzhnikov) * Improve heap-profiling sampling algorithm (ford) * Rewrite leak-checking code: should be faster and more robust (sanjay) * Use ps2 instead of ps for dot: better page cropping for gv (csilvers) * Disable malloc-failure warning messages by default (csilvers) * Update config/Makefile to disable tests on a per-OS basis (csilvers) * PORTING: Get perftools compiling under MSVC 7.1 again (csilvers) * PORTING: Get perftools compiling under cygwin again (csilvers) * PORTING: automatically set library flags for solaris x86 (csilvers) * Add TCMALLOC_SKIP_SBRK to mirror TCMALLOC_SKIP_MMAP (csilvers) * Add --enable flags to allow selective building (csilvers) * Put addr2line-pdb and nm-pdb in proper output directory (csilvers) * Remove deprecated DisableChecksIn (sanjay) * DOCUMENTATION: Document most MallocExtension routines (csilvers) git-svn-id: http://gperftools.googlecode.com/svn/trunk@66 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* Thu Dec 11 16:01:32 2008 Google Inc. <opensource@google.com>csilvers2008-12-131-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | * google-perftools: version 1.0rc1 release * Replace API for selectively disabling heap-checker in code (sanjay) * Add a pre-mmap hook (daven, adlr) * Add MallocExtension interface to set memory-releasing rate (fikes) * Augment pprof to allow any string ending in /pprof/profile (csilvers) * PORTING: Rewrite -- and fix -- malloc patching for windows (dvitek) * PORTING: Add nm-pdb and addr2line-pdb for use by pprof (dvitek) * PORTING: Improve cygwin and mingw support (jperkins, csilvers) * PORTING: Fix pprof for mac os x, other pprof improvements (csilvers) * PORTING: Fix some PPC bugs in our locking code (anton.blanchard) * A new unittest, smapling_test, to verify tcmalloc-profiles (csilvers) * Turn off TLS for gcc < 4.1.2, due to a TLS + -fPIC bug (csilvers) * Prefer __builtin_frame_address to assembly for stacktraces (nlewycky) * Separate tcmalloc.cc out into multiple files -- finally! (kash) * Make our locking code work with -fPIC on 32-bit x86 (aruns) * Fix an initialization-ordering bug for tcmalloc/profiling (csilvers) * Use "initial exec" model of TLS to speed up tcmalloc (csilvers) * Enforce 16-byte alignment for tcmalloc, for SSE (sanjay) git-svn-id: http://gperftools.googlecode.com/svn/trunk@60 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* Thu Sep 18 16:00:27 2008 Google Inc. <opensource@google.com>csilvers2008-09-191-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | * google-perftools: version 0.99 release * Add IsHeapProfileRunning (csilvers) * Add C shims for some of the C++ header files (csilvers) * Fix heap profile file clean-up logic (maxim) * Rename linuxthreads.c to .cc for better compiler support (csilvers) * Add source info to disassembly in pprof (sanjay) * Use open instead of fopen to avoid memory alloc (csilvers) * Disable malloc extensions when running under valgrind (kcc) * BUG FIX: Fix out-of-bound error by reordering a check (larryz) * Add Options struct to ProfileData (cgd) * Correct PC-handling of --base in pprof (csilvers) * Handle 1 function occurring twice in an image (sanjay) * Improve stack-data cleaning (maxim) * Use 'struct Foo' to make header C compatible (csilvers) * Add 'total' line to pprof --text (csilvers) * Pre-allocate buffer for heap-profiler to avoid OOM errors (csilvers) * Allow a few more env-settings to control tcmalloc (csilvers) * Document some of the issues involving thread-local storage (csilvers) * BUG FIX: Define strtoll and friends for windows (csilvers) git-svn-id: http://gperftools.googlecode.com/svn/trunk@54 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* Tue Feb 12 12:28:32 2008 Google Inc. <opensource@google.com>csilvers2008-02-131-14/+17
| | | | | | | | | | | | | | * google-perftools: version 0.95 release * Better -- not perfect -- support for linux-ppc (csilvers) * Fix race condition in libunwind stacktrace (aruns) * Speed up x86 spinlock locking (m3b) * Improve heap-checker performance (maxim) * Heap checker traverses more ptrs inside heap-alloced objects (maxim) * Remove deprecated ProfilerThreadState function (cgd) * Update libunwind documentation for statically linked binaries (aruns) git-svn-id: http://gperftools.googlecode.com/svn/trunk@44 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* * google-perftools: version 0.93 releasecsilvers2007-08-171-1/+1
| | | | | | | | | | | | | | | * PORTING: everything compiles on Solaris, OS X, FreeBSD (see INSTALL) * PORTING: cpu-profiler works on most platforms (much better GetPC()) * PORTING: heap-profiler works on most platforms * PORTING: improved windows support, including release builds * No longer build or run ptmalloc tests by default * Add support for using memfs filesystem to allocate memory in linux * WINDOWS: give debug library and release library different names Tue Jul 17 22:26:27 2007 Google Inc. <opensource@google.com> git-svn-id: http://gperftools.googlecode.com/svn/trunk@38 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* Tue Jul 17 22:26:27 2007 Google Inc. <opensource@google.com>csilvers2007-07-181-2/+7
| | | | | | | | | | | | | | | | | | * google-perftools: version 0.92 release * PERFORMANCE: use a packed cache to speed up tcmalloc * PORTING: preliminary windows support! (see README.windows) * PORTING: better support for solaris, OS X, FreeBSD (see INSTALL) * Envvar support for running the heap-checker under gdb * Add weak declarations to maybe_threads to fix no-pthreads compile bugs * Some 64bit fixes, especially with pprof * Better heap-checker support for some low-level allocations * Fix bug where heap-profiles would sometimes get truncated * New documentation about how to handle common heap leak situations * Use computed includes for hash_map/set: easier config * Added all used .m4 templates to the distribution git-svn-id: http://gperftools.googlecode.com/svn/trunk@36 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* Fri Apr 13 14:50:51 2007 Google Inc. <opensource@google.com>csilvers2007-04-161-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * google-perftools: version 0.90 release * (As the version-number jump hints, this is a major new release: almost every piece of functionality was rewritten. I can't do justice to all the changes, but will concentrate on highlights.) *** USER-VISIBLE CHANGES: * Ability to "release" unused memory added to tcmalloc * Exposed more tweaking knobs via environment variables (see docs) * pprof tries harder to map addresses to functions * tcmalloc_minimal compiles and runs on FreeBSD 6.0 and Solaris 10 *** INTERNAL CHANGES: * Much better 64-bit support * Better multiple-processor support (e.g. multicore contention tweaks) * Support for recent kernel ABI changes (e.g. new arg to mremap) * Addition of spinlocks to tcmalloc to reduce contention cost * Speed up tcmalloc by using __thread on systems that support TLS * Total redesign of heap-checker to improve liveness checking * More portable stack-frame analysis -- no more hard-coded constants! * Disentangled heap-profiler code and heap-checker code * Several new unittests to test, e.g., thread-contention costs * Lots of small (but important!) bug fixes: e.g., fixing GetPC on amd64 *** KNOWN PROBLEMS: * CPU-profiling may crash on x86_64 (64-bit) systems. See the README * Profiling/heap-checking may deadlock on x86_64 systems. See README git-svn-id: http://gperftools.googlecode.com/svn/trunk@28 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* Wed Jun 14 15:11:14 2006 Google Inc. <opensource@google.com>csilvers2007-03-221-0/+15
| | | | | | | | | | | | | | | | | | * google-perftools: version 0.8 release * Experimental support for remote profiling added to pprof (many) * Fixed race condition in ProfileData::FlushTable (etune) * Better support for weird /proc maps (maxim, mec) * Fix heap-checker interaction with gdb (markus) * Better 64-bit support in pprof (aruns) * Reduce scavenging cost in tcmalloc by capping NumMoveSize (sanjay) * Cast syscall(SYS_mmap); works on more 64-bit systems now (menage) * Document the text output of pprof! (csilvers) * Better compiler support for no-THREADS and for old compilers (csilvers) * Make libunwind the default stack unwinder for x86-64 (aruns) * Somehow the COPYING file got erased. Regenerate it (csilvers) git-svn-id: http://gperftools.googlecode.com/svn/trunk@23 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* Fri Jan 27 14:04:27 2006 Google Inc. <opensource@google.com>csilvers2007-03-221-0/+1
| | | | | | | | | | | | | | | | | * google-perftools: version 0.6 release * More sophisticated stacktrace usage, possibly using libunwind (aruns) * Update pprof to handle 64-bit profiles (dehnert) * Fix GetStackTrace to correctly return top stackframe (sanjay) * Add ANSI compliance for new and new[], including new_handler (jkearney) * More accuracy by reading ELF files directly rather than objdump (mec) * Add readline support for pprof (addi) * Add #includes for PPC (csilvers) * New PC-detection routine for ibook powerpc (asbestoshead) * Vastly improved tcmalloc unittest (csilvers) * Move documentation from /usr/doc to /usr/share/doc git-svn-id: http://gperftools.googlecode.com/svn/trunk@19 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* Wed Oct 26 15:19:16 2005 Google Inc. <opensource@google.com>csilvers2007-03-221-22/+62
| | | | | | | | | | | | | | | | | | | | | | | * Decrease fragmentation in tcmalloc (lefevere) * Support for ARM in some of the thread-specific code (markus) * Turn off heap-checker for statically-linked binaries, which cause error leak reports now (etune) * Many pprof improvements, including a command-line interface (jeff) * CPU profiling now automatically affects all threads in linux 2.6. (Kernel bugs break CPU profiling and threads in linux 2.4 a bit.) ProfilerEnable() and ProfilerDisable() are deprecated. (sanjay) * tcmalloc now correctly intercepts memalign (m3b, maxim) * Syntax fix: added missing va_end()s. Helps non-gcc compiling (etune) * Fixed a few coredumper bugs: race condition after PTRACE_DETACH, ignore non-aligned stackframe pointers (markus, menage) * 64-bit cleanup, especially for spinlock code (etune) and mmap (sanjay) * Better support for finding threads in linux (markus) * tcmalloc now tracks those stack traces that allocate memory (sanjay) * Work around a weird setspecific problem (sanjay) * Fix tcmalloc overflow problems when an alloc is close to 2G/4G (sanjay) git-svn-id: http://gperftools.googlecode.com/svn/trunk@15 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
* Tue May 31 08:14:38 2005 Google Inc. <opensource@google.com>csilvers2007-03-221-0/+236
* google-perftools: version 0.2 release * Use mmap2() instead of mmap(), to map more memory (menage) * Do correct pthread-local checking in heap-checker! (maxim) * Avoid overflow on 64-bit machines in pprof (sanjay) * Add a few more GetPC() functions, including for AMD (csilvers) * Better method for overriding pthread functions (menage) * (Hacky) fix to avoid overwriting profile files after fork() (csilvers) * Crashing bugfix involving dumping heaps on small-stack threads (tudor) * Allow library versions with letters at the end (csilvers) * Config fixes for systems that don't define PATH_MAX (csilvers) * Confix fixes so we no longer need config.h after install (csilvers) * Fix to pprof to correctly read very big cpu profiles (csilvers) * Fix to pprof to deal with new commandline flags in modern gv's * Better error reporting when we can't access /proc/maps (etune) * Get rid of the libc-preallocate code (which could crash on some systems); no longer needed with local-threads fix (csilvers) git-svn-id: http://gperftools.googlecode.com/svn/trunk@11 6b5cf1ce-ec42-a296-1ba9-69fdba395a50