summaryrefslogtreecommitdiff
path: root/src/zmalloc.c
Commit message (Collapse)AuthorAgeFilesLines
* Add info as requested by the original getMemorySize() license.antirez2014-12-171-0/+8
|
* getMemorySize() moved into zmalloc.c with other low level mem utils.antirez2014-12-171-0/+49
| | | | See issue #2218.
* Fix non-linux builds error introduced with THP checks.antirez2014-11-141-1/+1
|
* THP detection / reporting functions added.antirez2014-11-121-6/+18
|
* Allow atomic memory count update with C11 builtinsMatt Stancliff2014-06-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Use predefined macro for used_memory() updateMatt Stancliff2014-06-261-1/+1
|
* Sample and cache RSS in serverCron().antirez2014-03-241-2/+2
| | | | | | | | | | | | | 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.
* Fixed grammar: before H the article is a, not an.antirez2013-12-051-1/+1
|
* Fixed many typos.guiquanz2013-01-191-1/+1
|
* Use more fine grained HAVE macros instead of HAVE_PROCFS.antirez2012-11-211-2/+2
|
* zmalloc_get_private_dirty() function added (Linux only).antirez2012-11-191-0/+25
| | | | | | | For non Linux systmes it just returns 0. This function is useful to estimate copy-on-write because of childs saving stuff on disk.
* zmalloc: kill unused __size parameter in update_zmalloc_stat_alloc() macro.antirez2012-11-141-7/+7
|
* Fix a forget zmalloc_oom() -> zmalloc_oom_handler() replacement.antirez2012-08-241-1/+1
|
* Better Out of Memory handling.antirez2012-08-241-4/+10
| | | | | | | | | | | | | | | | | | | 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).
* define zlibc_free() in a way that is not shadowed by jemalloc.antirez2012-03-271-4/+9
|
* Produce the watchlog warning log in a way that is safer from a signal ↵antirez2012-03-271-0/+4
| | | | handler. Fix a memory leak in the backtrace generation function.
* use gcc sync builtins for memory counter when possiblePremysl Hruby2012-02-261-9/+33
|
* Precision of getClientOutputBufferMemoryUsage() greatily improved, see issue ↵antirez2012-02-071-0/+14
| | | | #327 for more information.
* Fix crash on SPARC due to improper alignment of allocated memoryChris Lamb2011-11-161-1/+1
| | | | | | | | | | 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 <jurij@wooyd.org>. Signed-off-by: Chris Lamb <lamby@debian.org>
* no more allocation stats info in INFO, useless now that we have jemalloc.antirez2011-07-021-10/+0
|
* forward-ported changes in zmalloc.c/h to support jemalloc buildantirez2011-06-201-5/+10
|
* Fixed compilation on FreeBSDantirez2011-01-201-1/+1
|
* initial fix of the test suite to run both in in-memory and diskstore modeantirez2011-01-091-1/+1
|
* allocation stats in INFOantirez2011-01-091-12/+23
|
* zmalloc functions to get RSS and fragmentation refactored into two separated ↵antirez2010-11-021-8/+25
| | | | functions
* Don't use prefix when malloc_size() can be calledPieter Noordhuis2010-10-231-3/+14
| | | | | Also, use tcmalloc functions explicitly via macros to prevent symbol lookups to resolve to native malloc/free on OSX.
* memory fragmentation reporting in INFO also added for Mac OS Xantirez2010-09-021-6/+31
|
* memory fragmentation ratio in INFO outputantirez2010-09-021-0/+42
|
* Add zcalloc and use it where appropriateBenjamin Kramer2010-07-251-0/+14
| | | | | | | | | | | | | calloc is more effecient than malloc+memset when the system uses mmap to allocate memory. mmap always returns zeroed memory so the memset can be avoided. The threshold to use mmap is 16k in osx libc and 128k in bsd libc and glibc. The kernel can lazily allocate the pages, this reduces memory usage when we have a page table or hash table that is mostly empty. This change is most visible when you start a new redis instance with vm enabled. You'll see no increased memory usage no matter how big your page table is.
* redis.c split into many different C files.antirez2010-07-011-0/+158
networking related stuff moved into networking.c moved more code more work on layout of source code SDS instantaneuos memory saving. By Pieter and Salvatore at VMware ;) cleanly compiling again after the first split, now splitting it in more C files moving more things around... work in progress split replication code splitting more Sets split Hash split replication split even more splitting more splitting minor change