@@ -0,0 +1,1355 @@
+package ru.job4j.gc;%0A%0Apublic class User %7B%0A    String name;%0A    int age;%0A%0A    public User() %7B%0A%0A    %7D%0A%0A    public User(String name, int age) %7B%0A        this.name = name;%0A        this.age = age;%0A    %7D%0A%0A    @Override%0A    protected void finalize() throws Throwable %7B%0A        super.finalize();%0A        System.out.println(%22finalize%22);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        System.out.println(%22Start%22);%0A        info();%0A        User%5B%5D user = new User%5B1000000%5D;%0A%0A        System.out.println(%22---------------------%22);%0A        for (int i = 0; i %3C user.length; i++) %7B%0A            user%5Bi%5D = new User(%22User%22+i, i);%0A            // user%5Bi%5D = new User();%0A        %7D%0A%0A        for (int i = 0; i %3C user.length; i++) %7B%0A            user%5Bi%5D = null;%0A        %7D%0A%0A       // System.gc();%0A        System.out.println(%22Finish%22);%0A    %7D%0A%0A    public static void info() %7B%0A        int mb = 1024 * 1024;%0A%0A        Runtime runtime = Runtime.getRuntime();%0A        System.out.println(%22##### Heap utilization statistics %5BMB%5D #####%22);%0A%0A        System.out.println(%22Used Memory: %22 +%0A                (runtime.totalMemory() - runtime.freeMemory()) / mb);%0A%0A        System.out.println(%22Free Memory: %22 + runtime.freeMemory() / mb);%0A        System.out.println(%22Total memory: %22 + runtime.totalMemory() / mb );%0A        System.out.println(%22Max memory: %22 + runtime.maxMemory() / mb);%0A    %7D%0A%7D%0A

task #1589