The testing server provided by the company is VMware, claiming to give me 6G,
Physical memory is actually on demand. Until the real 6G physical memory, the lily is cold.
See the following article, think deliberately using Java programs to occupy 6G of memory, and then the invasion to the memory of the release,
It might be a good idea to use a real-world program, such as Oracle Database.
(Does a batch put in the plan task, every morning to work before the execution, will be much better?) )
Import Java.util.Vector;
Import Java.io.BufferedReader;
Import java.io.IOException;
Import Java.io.InputStreamReader;
public class Memoryeater
{
public static void Main (string[] args)
{
Vector v = new vector ();
try {
for (int i = 1; i < 4096; i++)//4K
{
byte b[] = new byte[1048576]; 1M
V.add (b);
Thread.Sleep (1000);
Runtime RT = Runtime.getruntime ();
System.out.println ("Free Memory" + rt.freememory ());
}
Readconsole ();
} catch (Exception e)
{
}
}
public static void Readconsole () throws IOException {
BufferedReader br = new BufferedReader (new InputStreamReader (system.in));
System.out.print ("Enter String");
String s = br.readline ();
}
}
$ java-xmx1024m Memoryeater
Http://alvinalexander.com/blog/post/java/java-program-consume-all-memory-ram-on-computer
A Java program that intentionally consumes memory memoryeater