Add jemalloc heap profilling in debug console

This commit is contained in:
wudeng
2019-04-30 15:35:43 +08:00
committed by 云风
parent 4159600fbc
commit 35aa00fb13
4 changed files with 69 additions and 10 deletions

View File

@@ -160,6 +160,8 @@ function COMMAND.help()
call = "call address ...",
trace = "trace address [proto] [on|off]",
netstat = "netstat : show netstat",
profactive = "profactive [on|off] : active/deactive jemalloc heap profilling",
dumpheap = "dumpheap : dump heap profilling",
}
end
@@ -421,4 +423,19 @@ function COMMAND.netstat()
convert_stat(info)
end
return stat
end
end
function COMMAND.dumpheap()
memory.dumpheap()
end
function COMMAND.profactive(flag)
if flag ~= nil then
if flag == "on" or flag == "off" then
flag = toboolean(flag)
end
memory.profactive(flag)
end
local active = memory.profactive()
return "heap profilling is ".. (active and "active" or "deactive")
end