???????
??????????????????????????????????λ????????ú???????????д???С???????????????????????????????Linux?±????????????????????Σ????????μ??????Ubuntu?????е????

package eu.plumbr.demo;
public class OOM {
public static void main(String[] args){
java.util.List l = new java.util.ArrayList();
for (int i = 10000; i < 100000; i++) {
try {
l.add(new int[100_000_000]);
} catch (Throwable t) {
t.printStackTrace();
}
}
}
}
???????????????????? Out of memory: Kill process <PID> (java) score <SCORE> or sacrifice child?????
????????????????????????????????????С??????????????????У??????-Xm2g??????2G??С??????????????????????μ??????
????swapoff -a
????dd if=/dev/zero of=swapfile bs=1024 count=655360
????mkswap swapfile
????swapon swapfile
?????????????
????????????кü?????????????????????????У?????????????????????????????????????????????????????????????????????????????????????????????????JVM???GC??????????????μ??????????????????????????????
???????б???Щ????????OOM killer??????????????????????????С??????????????????ó??????????????