Revert "Now maxmemory, VM, and everything else uses the fast RSS memory used estimation instead of raw memory reported by zmalloc(). This means that setting maxmemory to 2GB will really have the effect of using up to 2GB of memory."

This reverts commit a3e60027e7.
This commit is contained in:
antirez
2010-11-02 12:09:59 +01:00
parent a3e60027e7
commit ca734d17ad
3 changed files with 17 additions and 15 deletions

View File

@ -280,11 +280,11 @@ int loadAppendOnlyFile(char *filename) {
/* Handle swapping while loading big datasets when VM is on */
force_swapout = 0;
if ((redisEstimateRSS() - server.vm_max_memory) > 1024*1024*32)
if ((zmalloc_used_memory() - server.vm_max_memory) > 1024*1024*32)
force_swapout = 1;
if (server.vm_enabled && force_swapout) {
while (redisEstimateRSS() > server.vm_max_memory) {
while (zmalloc_used_memory() > server.vm_max_memory) {
if (vmSwapOneObjectBlocking() == REDIS_ERR) break;
}
}