November 2017
Intermediate to advanced
398 pages
10h 14m
English
This error is thrown by the operating system. The operating system has processes which are governed by various kernel jobs. One of these jobs is out of memory killer. This job monitors the low memory situation and kills the rogue process which is consuming more memory resources. See the following example, which runs a loop and adds int array to a list. Eventually, you will get this error. Please note that you may need to tweak the swap file and heap sizes on your system:
import java.util.ArrayList;import java.util.List;public class KillProcess { public static void main(String[] args){ List<int[]> myArrayList = new ArrayList(); KillProcess kp = new KillProcess(); kp.processKillLoop(myArrayList); ...