若是你的linux用戶跑了不少程序,java進程等等,就有可能出現以下問題:
There is insufficient memory for the Java Runtime Environment to continue.
Cannot create GC thread. Out of system resources.
或者
java.io.IOException: Too many open files
出現這個緣由,有多是系統限制了用戶的資源使用,因此須要使用ulimit來設置用戶能得到的資源,使用命令:ulimit -a,查看資源配置狀況,通常咱們須要修改的是open files和max user processes,open files對應的配置是nofile,用戶打開文件最大的數量,max user processes對應的配置是nproc,用戶啓動最大的線程數。java
* soft noproc 143622 * hard noproc 143622 * soft nofile 196605 * hard nofile 196605
* soft nproc 143622 * hard nproc 143622
修改後重啓或從新ssh鏈接服務器,使用命令ulimit -a便可看到效果。
參考:
ulimit -a詳解
Linux下修改ulimit設置的最大進程linux