test/hotspot/jtreg/runtime/appcds/javaldr/GCDuringDumpTransformer.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Cdiff test/hotspot/jtreg/runtime/appcds/javaldr/GCDuringDumpTransformer.java

test/hotspot/jtreg/runtime/appcds/javaldr/GCDuringDumpTransformer.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 26,51 **** import java.lang.instrument.Instrumentation; import java.lang.instrument.IllegalClassFormatException; import java.security.ProtectionDomain; public class GCDuringDumpTransformer implements ClassFileTransformer { - static int n = 0; public byte[] transform(ClassLoader loader, String name, Class<?> classBeingRedefined, ProtectionDomain pd, byte[] buffer) throws IllegalClassFormatException { - n++; - - System.out.println("dump time loading: " + name + " in loader: " + loader); - System.out.println("making garbage: " + n); try { makeGarbage(); } catch (Throwable t) { t.printStackTrace(); try { Thread.sleep(200); // let GC to have a chance to run } catch (Throwable t2) {} } - System.out.println("making garbage: done"); return null; } private static Instrumentation savedInstrumentation; --- 26,45 ----
test/hotspot/jtreg/runtime/appcds/javaldr/GCDuringDumpTransformer.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File