@@ -0,0 +1,1536 @@
+package GcDefinition;%0A%0Aimport java.util.HashMap;%0A%0A/**%0A * Created by chenyang on 2017/2/2.%0A */%0A%0Apublic class StopWorldTest %7B%0A%0A    public static class MyThread extends Thread%7B%0A        HashMap%3CLong,byte%5B%5D%3E map=new HashMap%3CLong, byte%5B%5D%3E();%0A%0A        @Override%0A        public void run() %7B%0A            try %7B%0A                while (true)%7B%0A                    if(map.size()*512/1024/1024%3E=450)%7B%0A                        System.out.println(%22============%E5%87%86%E5%A4%87%E6%B8%85%E7%90%86==========:%22+map.size());//%E5%A4%A7%E4%BA%8E450M%E6%97%B6%EF%BC%8C%E6%B8%85%E7%90%86%E5%86%85%E5%AD%98%E3%80%82%0A                        map.clear();%0A                        System.out.println(%22clean map%22);%0A                    %7D%0A                    for(int i=0;i%3C1024;i++)%7B%0A                        map.put(System.nanoTime(),new byte%5B512%5D);//%E6%B6%88%E8%80%97%E5%86%85%E5%AD%98%E3%80%82%0A                    %7D%0A                    Thread.sleep(1);%0A                %7D%0A            %7Dcatch (Exception e)%7B%0A                e.printStackTrace();%0A            %7D%0A        %7D%0A    %7D%0A    public static class PrintThread extends Thread %7B%0A%0A        public static final long starttime = System.currentTimeMillis();%0A%0A        @Override%0A        public void run() %7B%0A            try %7B%0A                while (true) %7B%0A                    long t = System.currentTimeMillis() - starttime;%0A                    System.out.println(%22time:%22 + t);%0A                    Thread.sleep(100);%0A                %7D%0A            %7D catch (Exception e) %7B%0A%0A            %7D%0A        %7D%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        MyThread t=new MyThread();%0A        PrintThread p=new PrintThread();%0A        t.start();%0A        p.start();%0A    %7D%0A%7D%0A

update code