Netflix / zuul

Zuul is a gateway service that provides dynamic routing, monitoring, resiliency, security, and more.
Apache License 2.0
13.44k stars 2.37k forks source link

WARN com.netflix.zuul.netty.server.DirectMemoryMonitor - Error in DirectMemoryMonitor task. #641

Open shaoqinhe opened 4 years ago

shaoqinhe commented 4 years ago
[pool-5-thread-1] WARN com.netflix.zuul.netty.server.DirectMemoryMonitor - Error in DirectMemoryMonitor task.
java.lang.NullPointerException
    at com.netflix.servo.monitor.LongGauge.set(LongGauge.java:42)
    at com.netflix.zuul.netty.server.DirectMemoryMonitor$Task.run(DirectMemoryMonitor.java:78)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

请问 DirectMemoryMonitor类里面的 Field maxMemory = c.getDeclaredField("DIRECT_MEMORY_LIMIT") && Field reservedMemory = c.getDeclaredField("DIRECT_MEMORY_COUNTER") 的值是哪里获取的,为甚么一直为空?

carl-mastrangelo commented 4 years ago

@shaoqinhe What JDK version are you using?

shaoqinhe commented 4 years ago

The version is jdk1.8.0_191

GitJelly commented 3 years ago

I am facing the same problem. Any solutions to it?

artgon commented 3 years ago

I can't repro this. Do you have steps?

roycebranning commented 3 years ago

had this same error (although I was using jdk 11). i was using zuul-core 2.1.4, updating to 2.1.8 fixed it.

I believe this commit was responsible for the fix.