I’m trying to use ExecutorService.newFixedThreadPool to running several tasks. Every time I submit to ExecutorService, I will new a class() which holds task related information.
Will it cause memory leak as time goes?
For example, will there be 1M classes if I submit() 1M times?
No the executor service will not hold a reference beyond the lifetime of the task.