java-concurrent
java-concurrent copied to clipboard
use TracedExecutorService occur OOM
we used TracedExecutorService occur oom when service run long time with high throughput
code :

jvm dump analyze :

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?
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 。