Commit Graph

810 Commits

Author SHA1 Message Date
alkondratenko@gmail.com
7fcb5ac069 issue-511: implemented rel8 jump patching
I've found that Visual Studio 2012 release 32-bit C runtime library
patching fails because array new has rel8 jmp which previous code
could not handle.

Implementation is largely copied from conditional jumps handling code.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@213 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-07 19:13:29 +00:00
alkondratenko@gmail.com
8cb4086a0a issue-368: test that we don't fragment large spans too badly
This adds unit test that does essentially same things as code to
reproduce bug in
https://code.google.com/p/gperftools/issues/detail?id=368




git-svn-id: http://gperftools.googlecode.com/svn/trunk@212 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-06 19:50:59 +00:00
alkondratenko@gmail.com
f25ac4421f issue-{368,443}: allocate metadata in big batches
It uses same approach as PageHeapAllocator. Namely allocates big chunk
which is then used to satisfy smaller allocations.

In issue-443 gradual heap grows causes old code that allocates
metadata in smaller pieces and thus more frequently to fragment the
heap. It's also causing most of 368 heap fragmentation too.

New code allocates 8 megs of address space at once for metadata
allocations. Most OSes will allocate actual memory only when
corresponding pages are touched. Thus this change should not cause
increased memory usage.

I've also made sure metadata is always properly aligned in case we
ever allocate something that breaks natural alignment. E.g. strings.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@211 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-06 19:50:23 +00:00
alkondratenko@gmail.com
4fd762cead issue-368: unmap free spans and retry before growing heap
Because unmapped spans are not coalesced with normal spans it's
possible that we indeed have a large enough free span, but we fail to
see that because we always consider unmapped and normal spans
separately. That behavior is more likely for larger spans.

In order to protect programs that grow heap frequently and by small
amounts from much more frequent minor page faults, there's limit of
running that force pages unmap path once per 128 megs of heap growth.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@210 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-06 19:49:48 +00:00
alkondratenko@gmail.com
99fe9944de issue-510: remove duplicate arm #elif
git-svn-id: http://gperftools.googlecode.com/svn/trunk@209 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-04-01 05:32:22 +00:00
alkondratenko@gmail.com
6354e2c8cd issue-506: fixed bogus unit test failure
Looks like my version of GCC is aware that free(malloc(X)) is a
no-op. So it optimizes that away completely ignoring simple fact that
we're observing malloc hooks invocations. By adding check that malloc
succeeded we force gcc to actually preserve that malloc call.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@208 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:24:49 +00:00
alkondratenko@gmail.com
7896dcb9db issue-504: disable tls on mingw
Which is known to fail.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@207 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:16:47 +00:00
alkondratenko@gmail.com
8bf4522aa5 issue-504: do not define HAVE_MMAP on mingw
Because, clearly, windows doesn't have one



git-svn-id: http://gperftools.googlecode.com/svn/trunk@206 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:15:46 +00:00
alkondratenko@gmail.com
9c24d255cd issue-504: add AM_LDFLAGS to all *_la targets
Because automake will not automatically add AM_LDFLAGS if there's
per-target LDFLAGS. See their good info manual.

This fixes .dll compilation of tcmalloc



git-svn-id: http://gperftools.googlecode.com/svn/trunk@205 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:15:23 +00:00
alkondratenko@gmail.com
a2275fc6b4 issue-504: don't try to typedef pid_t on mingw
Because recent mingws (more then few years ago seemingly) do that
already.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@204 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:14:18 +00:00
alkondratenko@gmail.com
f00977533d issue-504: use gcc inline assembly atomic ops on mingw
Because those are well tested and can be trusted



git-svn-id: http://gperftools.googlecode.com/svn/trunk@203 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:13:53 +00:00
alkondratenko@gmail.com
34cdd6821b issue-504: use lowercase windows includes for mingw x-compilation
I.e. so that I can build tcmalloc.dll using comfortable environment of
my GNU/Linux box and without having to touch actual windows box or VM.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@202 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:13:13 +00:00
alkondratenko@gmail.com
0971d80d0e issue-503: updated svn:ignore to ignore generated files
git-svn-id: http://gperftools.googlecode.com/svn/trunk@201 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 18:35:16 +00:00
alkondratenko@gmail.com
05b100d9d4 issue-503: removed checked in configure and other auto* products
So that it's easier to contribute and review contributions.

People wishing to build gperftools from svn checkout should run
autogen.sh first which will create those files and then ./configure &&
make as usual

INSTALL file has updated instructions too.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@200 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 18:32:05 +00:00
alkondratenko@gmail.com
dcf55b976f issue-503: recover original INSTALL file
That was accidently overwritten by autotools files update in r196



git-svn-id: http://gperftools.googlecode.com/svn/trunk@199 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 18:29:00 +00:00
chappedm@gmail.com
5037f687d1 issue-425: Fixed tcmalloc unittest crashes for windows builds
Missing use of volatile was causing vs2010 to perform unwanted
optimization resulting in the crash. See issue for more details.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@198 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 01:35:37 +00:00
chappedm@gmail.com
beb78cc05b issue-493: Fix for building against ARM targets
gperftools was failing to build for arm targets for the following reasons:
1. Some ARMv7 instructions used when the target is ARMv6 so those fail to assemble
2. The cache line length is undefined for ARM architectures


git-svn-id: http://gperftools.googlecode.com/svn/trunk@197 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 00:23:03 +00:00
chappedm@gmail.com
bd3b3a7e9a issue-496: Fixes an issue where tcmalloc might deadlock in a thread calling fork
tcmalloc contained a bug where some internal locks were left in a undefined state
between fork, leaving the child process in a deadlock state. This patch fixes the
issue by introducing stricter locking between the parent nd child while forking.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@196 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-10 20:17:21 +00:00
chappedm@gmail.com
560ca8650c issue-491: Significant performance improvement for spin lock contention
This patch fixes issues where spinlocks under contention were failing to
wakeup waiters, sometimes resulting in blow ups from 13ns to as high as 256ms.
Under heavy contention, applications were observed sleeping for minutes at a
time giving the appearance of a hang.  


git-svn-id: http://gperftools.googlecode.com/svn/trunk@195 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-10 20:02:46 +00:00
chappedm@gmail.com
b591d53af9 issue-490: Added support for acquire/release atomic exchange
The atomic ops API was missing support for all of the various
flavors of Acquire_AtomicExchange and Release_AtomicExchange
which have now been added.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@194 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-10 19:54:39 +00:00
chappedm@gmail.com
687207b5fc issue-443: Increase the number of objects transferred between thread cache and central free list
This fix is a result of a performance degradation observed in multi-threaded programs where large
amounts of memory (30GB) are consumed, released by a pool of threads in a cyclic manner. This was
mainly due to the amount of time we were spending in the slow path consolidating memory between
the thread cache and central free list. The default has been bumped up to 32768 and is now also
controllable through the TCMALLOC_TRANSFER_NUM_OBJ environment setting.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@193 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-10 19:44:43 +00:00
alkondratenko@gmail.com
19eff86f85 actually made svn:ignore work
git-svn-id: http://gperftools.googlecode.com/svn/trunk@192 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-09 01:16:17 +00:00
alkondratenko@gmail.com
177a896a82 added proper svn:ignore
git-svn-id: http://gperftools.googlecode.com/svn/trunk@191 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-09 01:06:58 +00:00
chappedm@gmail.com
b96203b591 issue-461: Fix to malloc_extension.h so that it builds with -std=gnu++98
git-svn-id: http://gperftools.googlecode.com/svn/trunk@190 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-12-22 20:14:08 +00:00
chappedm@gmail.com
84b983c8d4 issue-465: Adding automagic support for __builtin_expect
Previously __builtin_ expect was based on a macro check against gcc version.
Now we perform the check via AM which is a cleaner approach. There are also
a number of code changes here to utilize LIKELY/UNLIKELY macros based on
__builtin_expect to improve performance.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@189 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-12-22 20:06:47 +00:00
chappedm@gmail.com
a5dacccd6a issue-466: Clarified stats output and comments for ExtractStats() and GetThreadStats()
git-svn-id: http://gperftools.googlecode.com/svn/trunk@188 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-12-22 19:06:35 +00:00
chappedm@gmail.com
09d97533b0 issue-467: Fixed issue with allocation size being narrowed to 32-bit
git-svn-id: http://gperftools.googlecode.com/svn/trunk@187 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-12-22 19:02:52 +00:00
chappedm@gmail.com
990889e623 issue-470: Allows the default system allocator to be overidden
This is useful when you run into cases where you need an allocator
before tcmalloc has been fully initialized.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@186 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-12-22 18:53:18 +00:00
chappedm@gmail.com
3bf5f55d78 issue-482: Adds support for CACHELINE_ALIGNED value for arm based devices
Hardcoded the cacheline size to 32 because this value is supported by several
arm devices, however a better logic needs to be implemented at some point to
handle more arm devices.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@185 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-12-22 18:38:48 +00:00
chappedm@gmail.com
6856d1d1b2 issue-488: Performance improvement for initialization checks
These came in from the Google-internal version of tcmalloc. They saw some
decent speed improvements, both on microbenchmarks and big programs. The
idea is to improve the speed of the "Is everything initialized?" type of
code, that's at the start of all allocations and deallocations.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@184 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-12-22 18:34:43 +00:00
chappedm@gmail.com
ad5aa05838 issue-483: Speed up accesses to ClassIndex()
Making its return type unsigned can save a conversion from
signed to unsigned, and getting rid of the ternary operators
seems to help a little bit as well. Various gcc versions weren't
generating conditional moves for them as one would expect.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@183 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-12-22 18:25:58 +00:00
chappedm@gmail.com
8de78fd85b issue-452: Adds a control mechanism to the cpu profiler to be switched on and off using a user defined signal.
CPUPROFILESIGNAL - Takes a signal number between the value of 1 and 64 inclusive which represents a signal
                   number as defined by signal.h. The signal must not be in use by the program. Sending this
                   signal to the program turns profiling on and off like a switch. By default the switch is
                   off when the program starts. Successive profiles are suffixed with a monotonically increasing
                   number.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@182 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-05 04:45:01 +00:00
chappedm@gmail.com
46f06ca0db issue-451: Fixed incorrect assembly for 64-bit barrier load and store on windows platforms.
git-svn-id: http://gperftools.googlecode.com/svn/trunk@181 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-04 23:08:17 +00:00
chappedm@gmail.com
5fe91d5623 issue-450: Move includes for struct mallinfo from tcmalloc.cc to tcmalloc.h to fix compiler warnings from clang.
git-svn-id: http://gperftools.googlecode.com/svn/trunk@180 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-04 22:53:01 +00:00
chappedm@gmail.com
86a55316ba issue-449: Disables mmap check when cross compiling since it is meaningless anyways
git-svn-id: http://gperftools.googlecode.com/svn/trunk@179 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-04 19:12:42 +00:00
chappedm@gmail.com
6f6c2bf685 issue-448: New environment setting that allows you to set an explicit heap limit
TCMALLOC_HEAP_LIMIT_MB - The maximum amount of heap memory that tcmalloc can use.
TCMALLOC_DISABLE_MEMORY_RELEASE - emulate platform with no MADV_DONTNEED support (generally for testing purposes).


git-svn-id: http://gperftools.googlecode.com/svn/trunk@178 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-04 19:02:15 +00:00
chappedm@gmail.com
644b1c6e35 issue-445: Fix for wrong cmpx instruction in OSAtomicCompareAndSwap64 for ppc64
git-svn-id: http://gperftools.googlecode.com/svn/trunk@177 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-04 18:30:05 +00:00
chappedm@gmail.com
e32bb2d9a7 issue-444: Fix for invalid conversion build error in signal handler code
git-svn-id: http://gperftools.googlecode.com/svn/trunk@176 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-04 18:24:46 +00:00
chappedm@gmail.com
abeaf46028 issue-430: Introduces 8-byte alignment support for tcmalloc
git-svn-id: http://gperftools.googlecode.com/svn/trunk@175 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-04 18:15:11 +00:00
chappedm@gmail.com
baaf018829 issue-473: Fix for make install error regarding src/windows/google/tcmalloc.h
git-svn-id: http://gperftools.googlecode.com/svn/trunk@174 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-04 17:41:47 +00:00
chappedm@gmail.com
1363bc6955 issue-475: Re-applying changes made originally for r150 and r151
- Used aclocal, autoupdate, autoconf, and automake to correctly apply changes made to Makefile.am. Detailed instructions on this procedure can be found here http://inti.sourceforge.net/tutorial/libinti/autotoolsproject.html.
- Fixed a number of error/warning messages due to use of newer aclocal, autoconf, and automake utilities.
- Directly and indirectly related to issue-385 and issue-480.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@173 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-04 17:21:00 +00:00
chappedm@gmail.com
1243295cdc issue-475: Amend of r151 and r150
In revisions 151 and 150 an attempt was made to enable frame pointers by default for i386. However, in the process of doing so a number of files were inadvertently touched as a result of running autogen.sh. As a result, I have needed to roll back these revisions so that I can reattempt the change.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@172 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-04 15:59:08 +00:00
chappedm@gmail.com
5c17459c5e issue-476: Amendment to r152:issue-437 to fix a build error due to PR_SET_TRACER not being defined in older glibc releases.
git-svn-id: http://gperftools.googlecode.com/svn/trunk@171 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-03 16:14:25 +00:00
chappedm@gmail.com
6287bbbbad issue-477: Fix clang compilation errors regarding format specifiers
git-svn-id: http://gperftools.googlecode.com/svn/trunk@170 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-03 15:56:27 +00:00
chappedm@gmail.com
87699c97cc issue-478: Added the heap profiler tunnable setting HEAP_PROFILER_TIME_INTERVAL used to dump heap profiles on a specified time interval.
git-svn-id: http://gperftools.googlecode.com/svn/trunk@169 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-03 15:40:01 +00:00
chappedm@gmail.com
4eb6946d68 issue-479: Replaced sscanf usage while iterating proc maps entries to fix a deadlock introduced by glibc-2.15.
git-svn-id: http://gperftools.googlecode.com/svn/trunk@168 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-03 15:27:58 +00:00
chappedm@gmail.com
5dd53ab6cb issue-481: Replaced test mechanism for distinct address spaces with a more reliable mechanism
Rather than using sys_ptrace+PTRACE_PEEK_DATA to determine whether address spaces are distinct, we now use sys_waitpid+__WCLONE. See issue-481 for a more detailed rationale.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@167 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-03 14:52:42 +00:00
chappedm@gmail.com
6c43620352 amend-r165: forgot to regenrate configure and Makefile.in
git-svn-id: http://gperftools.googlecode.com/svn/trunk@166 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-03 14:36:33 +00:00
chappedm@gmail.com
c566266b10 issue-480: duplicate of issue-385 fixed in r150 however some of the comments in the code
regarding frame pointers needed to be clarified.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@165 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-11-03 14:13:21 +00:00
chappedm@gmail.com
4f325fbcc9 issue-424: Updated heap profiler documentation that had mispelling for the heap profiler mmap only environment setting (HEAP_PROFILE_ONLY_MMAP)
git-svn-id: http://gperftools.googlecode.com/svn/trunk@164 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2012-10-28 19:45:03 +00:00