// threads max
// int maxThreads = Runtime.getRuntime().availableProcessors() *2 + 1;
int maxThreads = 5;
// Memory limitation: 1MB by channel, 1GB global, 100 ms of timeout
ThreadPoolExecutor pipelineExecutor = new OrderedMemoryAwareThreadPoolExecutor(maxThreads, 1048576, 1073741824,
100, TimeUnit.MILLISECONDS, new ObjectSizeEstimator() {
@Override
public int estimateSize(Object o) {
return 1000;
}
}, Executors.defaultThreadFactory());