java 安装
JVM配置
http://jvm-options.tech.xebia.fr/
centos
环境变量设置点。
给其他程序使用的环境变量设置
export JAVA_HOME=/usr/java/jdk1.7.0_79/
export JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$JRE_HOME/bin
export PATH
- ~/.bashrc
- ~/.bash_profile
- ~/.bash_login
- ~/.bashrc
- ~/.profile
- /etc/mavenrc
- ~/.mavenrc
最大线程数
代码
import java.util.concurrent.atomic.AtomicInteger;
public class TestThread extends Thread {
private static final AtomicInteger count = new AtomicInteger();
public static void main(String[] args) {
while (true)
try{
(new TestThread()).start();
}catch(Error e){
System.exit(-1);
}
}
@Override
public void run() {
System.out.println(count.incrementAndGet());
while (true)
try {
Thread.sleep(Integer.MAX_VALUE);
} catch (InterruptedException e) {
break;
}
}
}