History log of /redis-3.2.3/src/zmalloc.c (Results 1 – 25 of 30)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: 8.0-m02, 6.2.16, 7.2.6, 7.4.1, 8.0-m01, 7.4.0, 7.4-rc2, 7.4-rc1, 7.2.5, 7.2.4, 7.0.15, 7.2.3, 7.2.2, 7.0.14, 6.2.14, 6.2.15, 7.2.1, 7.0.13, 7.2.0, 7.2-rc3, 7.0.12, 6.2.13, 6.0.20, 7.2-rc2, 6.0.19, 6.2.12, 7.0.11, 7.2-rc1, 7.0.10, 7.0.9, 6.2.11, 6.0.18, 6.2.10, 6.0.17, 6.2.9, 7.0.8, 7.0.7, 7.0.6, 6.2.8, 7.0.5, 7.0.4, 7.0.3, 7.0.2, 7.0.1, 7.0.0, 6.2.7, 7.0-rc3, 7.0-rc2, 7.0-rc1, 6.2.6, 6.0.16, 5.0.14, 5.0.13, 6.0.15, 6.2.5, 6.0.14, 6.2.4, 6.2.3, 6.0.13, 6.2.2, 6.2.1, 6.0.12, 5.0.12, 6.0.11, 6.2.0, 5.0.11, 6.2-rc3, 6.0.10, 6.2-rc2, 6.2-rc1, 6.0.9, 5.0.10, 6.0.8, 6.0.7, 6.0.6, 6.0.5, 6.0.4, 6.0.3, 6.0.2, 6.0.1, 6.0.0, 5.0.9, 6.0-rc4, 6.0-rc3, 5.0.8, 6.0-rc2, 6.0-rc1, 5.0.7, 5.0.6, 5.0.5, 3.2.13, 4.0.14, 5.0.4, 4.0.13, 5.0.3, 4.0.12, 5.0.2, 5.0.1, 5.0.0, 5.0-rc6, 5.0-rc5, 4.0.11, 5.0-rc4, 5.0-rc3, 5.0-rc2, 4.0.10, 3.2.12, 5.0-rc1, 4.0.9, 4.0.8, 4.0.7, 4.0.6, 4.0.5, 4.0.4, 4.0.3, 3.2.11, 4.0.2, 3.2.10, 4.0.1, 4.0.0, 3.2.9, 4.0-rc3, 3.2.8, 3.2.7, 3.2.6, 4.0-rc2, 4.0-rc1, 3.2.5, 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2.0, 3.2.0-rc3, 3.0.7, 3.2.0-rc2, 3.2-rc1, 3.0.6, 2.8.24, 3.0.5, 2.8.23, 2.8.22, 3.0.4, 3.0.3, 3.0.2, 2.8.21, 2.8.20, 3.0.1, 3.0.0, 3.0.0-rc6, 3.0.0-rc5, 3.0.0-rc4, 3.0.0-rc3, 3.0.0-rc2
# 9a635431 17-Dec-2014 antirez <[email protected]>

Add info as requested by the original getMemorySize() license.


# 615f6923 17-Dec-2014 antirez <[email protected]>

getMemorySize() moved into zmalloc.c with other low level mem utils.

See issue #2218.


Revision tags: 2.8.19, 2.8.18
# 62090669 14-Nov-2014 antirez <[email protected]>

Fix non-linux builds error introduced with THP checks.


# 3ef0876b 12-Nov-2014 antirez <[email protected]>

THP detection / reporting functions added.


Revision tags: 3.0.0-rc1, 2.8.17, 2.8.16, 2.8.15, 2.8.14, 3.0.0-beta8, 2.8.13, 3.0.0-beta7
# a953c883 26-Jun-2014 Matt Stancliff <[email protected]>

Allow atomic memory count update with C11 builtins

From mailing list post https://groups.google.com/forum/#!topic/redis-db/QLjiQe4D7LA

In zmalloc.c the following primitives are currently used
to sy

Allow atomic memory count update with C11 builtins

From mailing list post https://groups.google.com/forum/#!topic/redis-db/QLjiQe4D7LA

In zmalloc.c the following primitives are currently used
to synchronize access to single global variable:
__sync_add_and_fetch
__sync_sub_and_fetch

In some architectures such as powerpc these primitives are overhead
intensive. More efficient C11 __atomic builtins are available with
newer GCC versions, see
http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/_005f_005fatomic-Builtins.html#_005f_005fatomic-Builtins

By substituting the following __atomic… builtins:
__atomic_add_fetch
__atomic_sub_fetch

the performance improvement on certain architectures such as powerpc can be significant,
around 10% to 15%, over the implementation using __sync builtins while there is only slight uptick on
Intel architectures because it was already enforcing Intel Strongly ordered memory semantics.

The selection of __atomic built-ins can be predicated on the definition of ATOMIC_RELAXED
which Is available on in gcc 4.8.2 and later versions.

show more ...


# f9bca13a 26-Jun-2014 Matt Stancliff <[email protected]>

Use predefined macro for used_memory() update


Revision tags: 2.8.12, 2.8.11, 3.0.0-beta6, 2.8.10, 3.0.0-beta5, 3.0.0-beta4, 3.0.0-beta3, 2.8.9, 2.8.8
# 93253c27 24-Mar-2014 antirez <[email protected]>

Sample and cache RSS in serverCron().

Obtaining the RSS (Resident Set Size) info is slow in Linux and OSX.
This slowed down the generation of the INFO 'memory' section.

Since the RSS does not requi

Sample and cache RSS in serverCron().

Obtaining the RSS (Resident Set Size) info is slow in Linux and OSX.
This slowed down the generation of the INFO 'memory' section.

Since the RSS does not require to be a real-time measurement, we
now sample it with server.hz frequency (10 times per second by default)
and use this value both to show the INFO rss field and to compute the
fragmentation ratio.

Practically this does not make any difference for memory profiling of
Redis but speeds up the INFO call significantly.

show more ...


Revision tags: 3.0.0-beta2, 2.8.7, 2.8.6, 3.0.0-beta1, 2.8.5, 2.8.4, 2.6.17, 2.8.3
# 11e81a1e 05-Dec-2013 antirez <[email protected]>

Fixed grammar: before H the article is a, not an.


Revision tags: 2.8.2, 2.8.1, 2.8.0, 2.8.0-rc6, 2.8.0-rc5, 2.8.0-rc4, 2.6.16, 2.6.15, 2.8.0-rc3, 2.8.0-rc2, 2.8.0-rc1, 2.6.14-2, 2.6.14-1, 2.6.14, 2.6.13, 2.6.12, 2.6.10-3, 2.6.10-2, 2.6.11, 2.6.10-1, 2.6.10, 2.6.9-1, 2.6.9
# 9d09ce39 16-Jan-2013 guiquanz <[email protected]>

Fixed many typos.


Revision tags: 2.6.8-1, 2.6.8, 2.6.7-1, 2.6.7, 2.6.6, 2.4.18, 2.6.5
# 3cb43283 21-Nov-2012 antirez <[email protected]>

Use more fine grained HAVE macros instead of HAVE_PROCFS.


# 3bfeb9c1 19-Nov-2012 antirez <[email protected]>

zmalloc_get_private_dirty() function added (Linux only).

For non Linux systmes it just returns 0.

This function is useful to estimate copy-on-write because of childs
saving stuff on disk.


# af0b2207 14-Nov-2012 antirez <[email protected]>

zmalloc: kill unused __size parameter in update_zmalloc_stat_alloc() macro.


Revision tags: 2.6.4, 2.6.3, 2.6.2, 2.6.1, 2.6.0, 2.6.0-rc8, 2.6.0-rc7, 2.4.17
# 1caa627e 24-Aug-2012 antirez <[email protected]>

Fix a forget zmalloc_oom() -> zmalloc_oom_handler() replacement.


# 6fdc6354 24-Aug-2012 antirez <[email protected]>

Better Out of Memory handling.

The previous implementation of zmalloc.c was not able to handle out of
memory in an application-specific way. It just logged an error on
standard error, and aborted.

Better Out of Memory handling.

The previous implementation of zmalloc.c was not able to handle out of
memory in an application-specific way. It just logged an error on
standard error, and aborted.

The result was that in the case of an actual out of memory in Redis
where malloc returned NULL (In Linux this actually happens under
specific overcommit policy settings and/or with no or little swap
configured) the error was not properly logged in the Redis log.

This commit fixes this problem, fixing issue #509.
Now the out of memory is properly reported in the Redis log and a stack
trace is generated.

The approach used is to provide a configurable out of memory handler
to zmalloc (otherwise the default one logging the event on the
standard output is used).

show more ...


Revision tags: 2.6.0-rc6, 2.4.16, 2.4.15, 2.6.0-rc5, 2.6.0-rc4, 2.4.14, 2.6.0-rc3, 2.6.0-rc2, 2.4.13, 2.4.12, 2.6.0-rc1, 2.4.11, 2.4.10
# d174eed5 27-Mar-2012 antirez <[email protected]>

define zlibc_free() in a way that is not shadowed by jemalloc.


# 23c0cdd2 27-Mar-2012 antirez <[email protected]>

Produce the watchlog warning log in a way that is safer from a signal handler. Fix a memory leak in the backtrace generation function.


Revision tags: 2.4.9
# 80ff1fc6 26-Feb-2012 Premysl Hruby <[email protected]>

use gcc sync builtins for memory counter when possible


Revision tags: 2.4.8
# 442246dd 07-Feb-2012 antirez <[email protected]>

Precision of getClientOutputBufferMemoryUsage() greatily improved, see issue #327 for more information.


Revision tags: 2.4.7, 2.4.6, 2.4.5, 2.4.4, 2.4.3
# 5ae979bf 16-Nov-2011 Chris Lamb <[email protected]>

Fix crash on SPARC due to improper alignment of allocated memory

I believe that you should be able to drop 'defined(__sun)' completely
from this clause, as Solaris on x86 hardware probably does not

Fix crash on SPARC due to improper alignment of allocated memory

I believe that you should be able to drop 'defined(__sun)' completely
from this clause, as Solaris on x86 hardware probably does not have
strict alignment requirements, but I don't have a way to test that.

Thanks to Jurij Smakov <[email protected]>.

Signed-off-by: Chris Lamb <[email protected]>

show more ...


Revision tags: 2.4.2, 2.2.15, 2.4.1, 2.4.0, 2.2.14, 2.4.0-rc8, 2.2.13, 2.4.0-rc7, 2.4.0-rc6, 2.4.0-rc5, 2.4.0-rc4, 2.2.12, 2.4.0-rc3
# 65046340 02-Jul-2011 antirez <[email protected]>

no more allocation stats info in INFO, useless now that we have jemalloc.


Revision tags: with-deprecated-diskstore, 2.2.111-scripting, 2.2.11
# 29d04257 20-Jun-2011 antirez <[email protected]>

forward-ported changes in zmalloc.c/h to support jemalloc build


Revision tags: 2.2.110-scripting, 2.2.10, 2.2.9, 2.4.0-rc2, 2.4.0-rc1, 2.2.8, 2.2.107-scripting, 2.2.7, 2.2.106-scripting, 2.2.6, 2.2.105-scripting, 2.2.5, 2.2.4, 2.2.3, 3.0-alpha0, 2.0.5, 2.2.2, 2.2.1, 2.2.0, 2.2.0-rc4
# c4df22af 20-Jan-2011 antirez <[email protected]>

Fixed compilation on FreeBSD


Revision tags: 2.2.0-rc3, 2.3-alpha0
# 5e1d2d30 09-Jan-2011 antirez <[email protected]>

initial fix of the test suite to run both in in-memory and diskstore mode


# 67a1810b 09-Jan-2011 antirez <[email protected]>

allocation stats in INFO


Revision tags: 2.2.0-rc2, 2.2.0-rc1, 2.2-alpha6, 2.2-alpha5, 2.0.4, v2.0.4-stable, 2.2-alpha4
# 92e28228 02-Nov-2010 antirez <[email protected]>

zmalloc functions to get RSS and fragmentation refactored into two separated functions


12