- 1660 addReplyBulkCString(c,"fragmentation"); /* this is the total RSS overhead, including fragmentation */
- 1661 addReplyDouble(c,mh->total_frag); /* it is kept here for backwards compatibility */
- 1662
- 1663 addReplyBulkCString(c,"fragmentation.bytes");
- 1664 addReplyLongLong(c,mh->total_frag_bytes);
- 1665
- 1666 freeMemoryOverheadData(mh);
- 1667 } else if (!strcasecmp(c->argv[1]->ptr,"malloc-stats") && c->argc == 2) {
- 1668 #if defined(USE_JEMALLOC)
- 1669 sds info = sdsempty();
- 1670 je_malloc_stats_print(inputCatSds, &info, NULL);
- 1671 addReplyVerbatim(c,info,sdslen(info),"txt");
- 1672 sdsfree(info);
- 1673 #else
- 1674 addReplyBulkCString(c,"Stats not supported for the current allocator");
- 1675 #endif
- 1676 } else if (!strcasecmp(c->argv[1]->ptr,"doctor") && c->argc == 2) {
- 1677 sds report = getMemoryDoctorReport();
- 1678 addReplyVerbatim(c,report,sdslen(report),"txt");
- 1679 sdsfree(report);
- 1680 } else if (!strcasecmp(c->argv[1]->ptr,"purge") && c->argc == 2) {
- 1681 if (jemalloc_purge() == 0)
- 1682 addReply(c, shared.ok);
- 1683 else
- 1684 addReplyError(c, "Error purging dirty pages");
- 1685 } else {
- 1686 addReplySubcommandSyntaxError(c);
- 1687 }
复制代码 |