|
@@ -29,9 +29,10 @@ public class DirectMemoryReporterImpl {
|
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(DirectMemoryReporterImpl.class);
|
|
|
|
|
|
-// @PostConstruct
|
|
|
-// public void init() {
|
|
|
-//
|
|
|
+ @PostConstruct
|
|
|
+ public void init() {
|
|
|
+ // TODO ( 设置netty 参数 复现 OutOfDirectMemoryError 异常 -Dio.netty.maxDirectMemory = 1938)
|
|
|
+
|
|
|
// try {
|
|
|
// Field field = ReflectionUtils.findField(PlatformDependent.class, "DIRECT_MEMORY_COUNTER");
|
|
|
// field.setAccessible(true);
|
|
@@ -47,13 +48,13 @@ public class DirectMemoryReporterImpl {
|
|
|
// @Override
|
|
|
// public void run() {
|
|
|
// System.out.println("task run:" + new Date());
|
|
|
-// long m = directMemory.get() / _ik;
|
|
|
-// logger.error(BUSINESS_KEY + "maxDirectMemory==={}:{}K", maxDirectMemory/_ik, m);
|
|
|
+// long m = directMemory.get() ;
|
|
|
+// logger.error(BUSINESS_KEY + "maxDirectMemory==={}:{}K", maxDirectMemory , m);
|
|
|
// }
|
|
|
// };
|
|
|
// Timer timer = new Timer();
|
|
|
// //安排指定的任务在指定的时间开始进行重复的固定延迟执行。这里是每3秒执行一次
|
|
|
// timer.schedule(timerTask, 10, 2000);
|
|
|
-// }
|
|
|
+ }
|
|
|
|
|
|
}
|