hotspot/test/gc/6581734/Test6581734.java
author eistepan
Wed, 19 Nov 2014 17:43:19 +0300
changeset 27692 11c231c781dc
parent 6426 cf377b51c52b
child 29678 dd2f3932c21e
permissions -rw-r--r--
8062537: [TESTBUG] Conflicting GC combinations in hotspot tests Reviewed-by: brutisso
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6245
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
     1
/*
27692
11c231c781dc 8062537: [TESTBUG] Conflicting GC combinations in hotspot tests
eistepan
parents: 6426
diff changeset
     2
 * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
6245
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
     4
 *
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
     7
 * published by the Free Software Foundation.
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
     8
 *
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    13
 * accompanied this code).
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    14
 *
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    18
 *
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    21
 * questions.
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    22
 */
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    23
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    24
/*
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    25
 * @test Test6581734.java
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    26
 * @bug 6581734
27692
11c231c781dc 8062537: [TESTBUG] Conflicting GC combinations in hotspot tests
eistepan
parents: 6426
diff changeset
    27
 * @requires vm.gc=="ConcMarkSweep" | vm.gc=="null"
6245
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    28
 * @summary CMS Old Gen's collection usage is zero after GC which is incorrect
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    29
 * @run main/othervm -Xmx512m -verbose:gc -XX:+UseConcMarkSweepGC Test6581734
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    30
 *
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    31
 */
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    32
import java.util.*;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    33
import java.lang.management.*;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    34
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    35
// 6581734 states that memory pool usage via the mbean is wrong
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    36
// for CMS (zero, even after a collection).
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    37
//
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    38
// 6580448 states that the collection count similarly is wrong
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    39
// (stays at zero for CMS collections)
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    40
// -- closed as dup of 6581734 as the same fix resolves both.
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    41
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    42
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    43
public class Test6581734 {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    44
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    45
    private String poolName = "CMS";
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    46
    private String collectorName = "ConcurrentMarkSweep";
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    47
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    48
    public static void main(String [] args) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    49
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    50
        Test6581734 t = null;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    51
        if (args.length==2) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    52
            t = new Test6581734(args[0], args[1]);
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    53
        } else {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    54
            System.out.println("Defaulting to monitor CMS pool and collector.");
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    55
            t = new Test6581734();
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    56
        }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    57
        t.run();
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    58
    }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    59
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    60
    public Test6581734(String pool, String collector) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    61
        poolName = pool;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    62
        collectorName = collector;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    63
    }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    64
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    65
    public Test6581734() {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    66
    }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    67
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    68
    public void run() {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    69
        // Use some memory, enough that we expect collections should
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    70
        // have happened.
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    71
        // Must run with options to ensure no stop the world full GC,
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    72
        // but e.g. at least one CMS cycle.
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    73
        allocationWork(300*1024*1024);
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    74
        System.out.println("Done allocationWork");
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    75
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    76
        // Verify some non-zero results are stored.
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    77
        List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    78
        int poolsFound = 0;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    79
        int poolsWithStats = 0;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    80
        for (int i=0; i<pools.size(); i++) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    81
            MemoryPoolMXBean pool = pools.get(i);
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    82
            String name = pool.getName();
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    83
            System.out.println("found pool: " + name);
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    84
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    85
            if (name.contains(poolName)) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    86
                long usage = pool.getCollectionUsage().getUsed();
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    87
                System.out.println(name + ": usage after GC = " + usage);
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    88
                poolsFound++;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    89
                if (usage > 0) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    90
                    poolsWithStats++;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    91
                }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    92
            }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    93
        }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    94
        if (poolsFound == 0) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    95
            throw new RuntimeException("No matching memory pools found: test with -XX:+UseConcMarkSweepGC");
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    96
        }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    97
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    98
        List<GarbageCollectorMXBean> collectors = ManagementFactory.getGarbageCollectorMXBeans();
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
    99
        int collectorsFound = 0;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   100
        int collectorsWithTime= 0;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   101
        for (int i=0; i<collectors.size(); i++) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   102
            GarbageCollectorMXBean collector = collectors.get(i);
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   103
            String name = collector.getName();
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   104
            System.out.println("found collector: " + name);
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   105
            if (name.contains(collectorName)) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   106
                collectorsFound++;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   107
                System.out.println(name + ": collection count = "
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   108
                                   + collector.getCollectionCount());
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   109
                System.out.println(name + ": collection time  = "
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   110
                                   + collector.getCollectionTime());
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   111
                if (collector.getCollectionCount() <= 0) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   112
                    throw new RuntimeException("collection count <= 0");
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   113
                }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   114
                if (collector.getCollectionTime() > 0) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   115
                    collectorsWithTime++;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   116
                }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   117
            }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   118
        }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   119
        // verify:
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   120
        if (poolsWithStats < poolsFound) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   121
            throw new RuntimeException("pools found with zero stats");
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   122
        }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   123
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   124
        if (collectorsWithTime<collectorsFound) {
6426
cf377b51c52b 6980392: TEST_BUG: gc/6581734/Test6581734.java has typo
kevinw
parents: 6245
diff changeset
   125
            throw new RuntimeException("collectors found with zero time");
6245
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   126
        }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   127
        System.out.println("Test passed.");
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   128
    }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   129
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   130
    public void allocationWork(long target) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   131
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   132
        long sizeAllocated = 0;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   133
        List list = new LinkedList();
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   134
        long delay = 50;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   135
        long count = 0;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   136
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   137
        while (sizeAllocated < target) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   138
            int size = 1024*1024;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   139
            byte [] alloc = new byte[size];
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   140
            if (count % 2 == 0) {
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   141
                list.add(alloc);
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   142
                sizeAllocated+=size;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   143
                System.out.print(".");
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   144
            }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   145
            try { Thread.sleep(delay); } catch (InterruptedException ie) { }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   146
            count++;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   147
        }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   148
    }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   149
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents:
diff changeset
   150
}