diff options
author | sumneko <sumneko@hotmail.com> | 2019-05-08 10:46:52 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-05-08 10:46:52 +0800 |
commit | c421e5c29e1cc6302739e69cdc8c9b7310a00e1a (patch) | |
tree | 9cd56c69f8ed19fc37f7e0804711e6bd1b0b40bf /server/src | |
parent | 9ddb1b4fdb1c1c214eee6d5c2ef41f4ced96234d (diff) | |
download | lua-language-server-c421e5c29e1cc6302739e69cdc8c9b7310a00e1a.zip |
更新体检
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/service.lua | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/server/src/service.lua b/server/src/service.lua index 1c2aec9c..9db272af 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -761,12 +761,16 @@ function mt:_testMemory() end local totalValue = 0 - for _ in pairs(valueMgr.watch) do + local deadValue = 0 + for value in pairs(valueMgr.watch) do totalValue = totalValue + 1 + if not value:getSource() then + deadValue = deadValue + 1 + end end local totalEmmy = self.emmy:count() - + local mem = collectgarbage 'count' local threadInfo = async.info local threadBuf = {} @@ -795,8 +799,10 @@ function mt:_testMemory() AlivedFunc:[%d]\n\z DeadFunc: [%d]\n\z -------------------\n\z - TotalLoc: [%d]\n\z TotalVal: [%d]\n\z + DeadVal: [%d]\n\z +-------------------\n\z + TotalLoc: [%d]\n\z TotalEmmy: [%d]\n\z'):format( mem, table.concat(threadBuf, '\n'), @@ -813,11 +819,14 @@ function mt:_testMemory() alivedFunction, deadFunction, - totalLocal, totalValue, + deadValue, + totalLocal, totalEmmy )) log.debug('test memory: ', ('%.3f'):format(os.clock() - clock)) + + self:_testDeadValue() end function mt:onTick() |