java-concurrent icon indicating copy to clipboard operation
java-concurrent copied to clipboard

use TracedExecutorService occur OOM

Open Steven-Z-Yang opened this issue 5 years ago • 2 comments
trafficstars

we used TracedExecutorService occur oom when service run long time with high throughput code : 15765618875297

jvm dump analyze :

jvmDump

Steven-Z-Yang avatar Dec 18 '19 03:12 Steven-Z-Yang

Both in TracedCallable and TracedRunnable any scope that gets activated is closed again after the operation.

Could it be that there are places where scopes are not closed properly? Which scope manager do you use?

sjoerdtalsma avatar Dec 18 '19 07:12 sjoerdtalsma

we used this scopManager: https://github.com/PacktPublishing/Mastering-Distributed-Tracing/blob/master/Chapter11/exercise1/lib/src/main/java/lib/MDCScopeManager.java

we use TracedExecutorService code is : @Async("asyncThreadExecutor") public void sendSms(List<String> list) { if (list.isEmpty()) { log.warn("empty list..."); } else { for(String str : list) { try { String response; response = restTemplate.getForObject("http://localhost:8080/test", String.class); log.info("execute call success....{}, {}", str, response); } catch (Exception ex) { ex.printStackTrace(); } } } }

it can reappear oom when execute sendSms many times 。

Steven-Z-Yang avatar Dec 19 '19 06:12 Steven-Z-Yang