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