We don't want to count AOF buffers and slaves output buffers as * used memory: the eviction should use mostly data size. This function * returns the sum of AOF and slaves buffer. */
| 328 | * used memory: the eviction should use mostly data size. This function |
| 329 | * returns the sum of AOF and slaves buffer. */ |
| 330 | size_t freeMemoryGetNotCountedMemory(void) { |
| 331 | size_t overhead = 0; |
| 332 | int slaves = listLength(server.slaves); |
| 333 | |
| 334 | if (slaves) { |
| 335 | listIter li; |
| 336 | listNode *ln; |
| 337 | |
| 338 | listRewind(server.slaves,&li); |
| 339 | while((ln = listNext(&li))) { |
| 340 | client *slave = listNodeValue(ln); |
| 341 | overhead += getClientOutputBufferMemoryUsage(slave); |
| 342 | } |
| 343 | } |
| 344 | if (server.aof_state != AOF_OFF) { |
| 345 | overhead += sdsalloc(server.aof_buf)+aofRewriteBufferSize(); |
| 346 | } |
| 347 | return overhead; |
| 348 | } |
| 349 | |
| 350 | /* Get the memory status from the point of view of the maxmemory directive: |
| 351 | * if the memory used is under the maxmemory setting then C_OK is returned. |
no test coverage detected