Commit 525a898e by Future

java实例内存大小监控

parent f7d85ec9
...@@ -8,6 +8,7 @@ import io.netty.channel.ChannelHandlerContext; ...@@ -8,6 +8,7 @@ import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.util.AttributeKey; import io.netty.util.AttributeKey;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.lucene.util.RamUsageEstimator;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Map; import java.util.Map;
...@@ -102,7 +103,7 @@ public class ChannelManager { ...@@ -102,7 +103,7 @@ public class ChannelManager {
clientInfo.setDeviceId(""); clientInfo.setDeviceId("");
clientInfo.setNioSocketChannel(channel); clientInfo.setNioSocketChannel(channel);
clientInfo.setToken(""); clientInfo.setToken("");
log.info("本地存缓存key {}", genKeyForSessionInfoMap(clientId, platform)); log.info("本地存缓存key {},大小 {}", genKeyForSessionInfoMap(clientId, platform), RamUsageEstimator.humanSizeOf(clientInfo));
ChannelManager.SESSION_INFO_MAP.put(genKeyForSessionInfoMap(clientId, platform), clientInfo); ChannelManager.SESSION_INFO_MAP.put(genKeyForSessionInfoMap(clientId, platform), clientInfo);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment