查看最大线程数: cat /proc/sys/kernel/threads-max ulimit User limits - limit the use of system-wide resources. Syntaxulimit [-acdfHlmnpsStuv] [limit] Options -S Change and report the soft limit associated with a resource. -H Change and report the hard limit
关于线程池的几个参数,很多人不是很清楚如何配置,他们之间是什么关系,我用代码来证明一下. package www.itbac.com; import java.util.concurrent.*; public class ExecutorTest { public static void main(String[] args) { // 创建线程池 , 参数含义 :(核心线程数,最大线程数,加开线程的存活时间,时间单位,任务队列长度) ThreadPoolExecutor pool = new