c3p0的helper线程数目过多导致内存溢出

前阵子做得那个系统发布了,结果刚放到服务器上就出了 outOfMemery 错误。 查看发现是由于下的进程导致的:

Daemon Thread [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] (Running)

经过查找,发现在datasource里把c3p0的numHelperThreads设成了1000。正是由于这个线程过多导致了内存溢出,改成10就没有问题了。附上c3p0里对于 numHelperThreads的描述:

numHelperThreads Default: 3 c3p0 is very asynchronous. Slow JDBC operations are generally performed by helper threads that don’t hold contended locks. Spreading these operations over multiple threads can significantly improve performance by allowing multiple operations to be performed simultaneously.

Implementing CorrelationID In Kafka Stream

今天在实现 `Logging Correlation ID` 的功能。理想状态下,我是期望能够在不影响业务逻辑代码的情况下,参照AOP的理念,给Topology的每个processor的增加如下行为: - 从header提取`CorrelationID`- 把`Corre...… Continue reading