Memory in JVM One of the benefits of JVM is the isolation of memory from the host OS, so that if there are some errors in the JVM, the influence is only limited to current JVM process. Actually, the memory in a JVM can be separated to many functional parts, for the simplicity, Heap, and Stack. The Heap is this article's target, Out of Memory Error When the Heap size running to its limitation, the out of Memory Error throws, and the process will crash. It is really easy to repeat this Error, and just write codes to allocate memory repeatedly. while (true) { byte [ ] twn = new byte [ ( int ) ( 1024 L * 1024 L * 20 ) ] ; mLists . add ( twn ) ; } If you write some cache or Memory management app, then it is really the critic part to manage the memory. There are many reasons to trigger this error, serious memory leak or memory limitation, so how to enlarge the memory limitation. java -Xmx:1024m -Xms:512m This is the common way for a general java command line p