From: antirez Date: Fri, 24 Aug 2012 10:55:37 +0000 (+0200) Subject: Better Out of Memory handling. X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/5de75120ba637d6193e02d99faea3f8071ac914b?hp=5de75120ba637d6193e02d99faea3f8071ac914b 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). ---