使用Weblogic版本:Weblogic 11g(10.3.6) 設(shè)置Weblogic的線程數(shù)有兩種方法, 第一種,通過啟動(dòng)參數(shù)設(shè)置: -Dweblogic.threadpool.MinPoolSize=1000 -Dweblogic.threadpool.MaxPoolSize=1000
可以加在setDomainEnv.sh文件JAVA_OPTIONS下面; 第二種,通過config.xml配置文件: <self-tuning-thread-pool-size-min>1000</self-tuning-thread-pool-size-min> <self-tuning-thread-pool-size-max>1000</self-tuning-thread-pool-size-max>
Window環(huán)境下設(shè)置完應(yīng)該直接重新啟動(dòng)就可以生效,Linux下,有可能會(huì)出現(xiàn)以下錯(cuò)誤: Attempting to allocate 4G bytes
There is insufficient native memory for the Java
Runtime Environment to continue.
The system is out of physical RAM or swap space
In 32 bit mode, the process size limit was hit
Reduce memory load on the system
Increase physical memory or swap space
Check if swap backing store is full
Use 64 bit Java on a 64 bit OS
Decrease Java heap size (-Xmx/-Xms)
Decrease number of Java threads
Decrease Java thread stack sizes (-Xss)
Disable compressed references (-XXcompressedRefs=false)
java.lang.OutOfMemoryError: Resource temporarily unavailable in tsStartJavaThread (lifecycle.c:1097).
Attempting to allocate 4G bytes
There is insufficient native memory for the Java
Runtime Environment to continue.
The system is out of physical RAM or swap space
In 32 bit mode, the process size limit was hit
Reduce memory load on the system
Increase physical memory or swap space
Check if swap backing store is full
Use 64 bit Java on a 64 bit OS
Decrease Java heap size (-Xmx/-Xms)
Decrease number of Java threads
Decrease Java thread stack sizes (-Xss)
Disable compressed references (-XXcompressedRefs=false)
出現(xiàn)這個(gè)原因的問題可能是因?yàn)長(zhǎng)inux下系統(tǒng)對(duì)用戶的默認(rèn)線程數(shù)做了限制,可以通過: ulimit -a
命令進(jìn)行查看: core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 515223 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 1024 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
其中 max user processes (-u) 1024
表示當(dāng)前系統(tǒng)允許的最大線程數(shù),可以把此參數(shù)設(shè)大一些。 ulimit -u 5000
設(shè)置當(dāng)前系統(tǒng)用戶最大允許的線程數(shù),只對(duì)本次會(huì)話有效,如果想要永久生效,可以通過修改: $ cat /etc/security/limits.d/90-nproc.conf # Default limit for number of user's processes to prevent # See rhbz #432903 for reasoning.
只需要將1024改成你需要的值即可,設(shè)置完需要重啟系統(tǒng)已生效。
|