Skip to content

Commit

Permalink
netty直接内存监控
Browse files Browse the repository at this point in the history
  • Loading branch information
liuganghuan committed Jul 12, 2023
1 parent 07b3b82 commit 0fdd7c9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.arloor.forwardproxy.monitor;

import com.google.common.collect.Lists;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.util.internal.PlatformDependent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -116,7 +117,8 @@ private String fixName(String name) {
}

private long nettyUsedDirectMemory() {
return PlatformDependent.usedDirectMemory();
// return PlatformDependent.usedDirectMemory();
return PooledByteBufAllocator.DEFAULT.metric().usedDirectMemory();
}

private static List<Metric<Long>> procNetDevMetric() {
Expand Down

0 comments on commit 0fdd7c9

Please sign in to comment.