@@ -0,0 +1,1586 @@
+import java.util.Map;%0Aimport java.util.concurrent.atomic.AtomicInteger;%0A%0Aimport com.sun.btrace.annotations.BTrace;%0Aimport com.sun.btrace.annotations.OnMethod;%0Aimport com.sun.btrace.annotations.OnTimer;%0Aimport com.sun.btrace.annotations.Self;%0A%0Aimport static com.sun.btrace.BTraceUtils.Atomic.incrementAndGet;%0Aimport static com.sun.btrace.BTraceUtils.Atomic.newAtomicInteger;%0Aimport static com.sun.btrace.BTraceUtils.Collections.get;%0Aimport static com.sun.btrace.BTraceUtils.Collections.newHashMap;%0Aimport static com.sun.btrace.BTraceUtils.Collections.put;%0Aimport static com.sun.btrace.BTraceUtils.Collections.size;%0Aimport static com.sun.btrace.BTraceUtils.classOf;%0Aimport static com.sun.btrace.BTraceUtils.compare;%0Aimport static com.sun.btrace.BTraceUtils.jstackStr;%0Aimport static com.sun.btrace.BTraceUtils.name;%0Aimport static com.sun.btrace.BTraceUtils.printNumberMap;%0A%0A@BTrace%0Apublic class URLClassLoaderCreation %7B%0A%09private static Map%3CString, AtomicInteger%3E histo = newHashMap();%0A%0A%09@OnMethod(%0A%09%09%09clazz = %22java.net.URLClassLoader%22,%0A%09%09%09method = %22%3Cinit%3E%22)%0A%09public static void onInit(@Self Object thisObject) %7B%0A%09%09if (compare(name(classOf(thisObject)), %22java.net.URLClassLoader%22)) %7B%0A%09%09%09String stackTrace = jstackStr(6);%0A%09%09%09AtomicInteger counter = get(histo, stackTrace);%0A%09%09%09if (counter == null) %7B%0A%09%09%09%09counter = newAtomicInteger(1);%0A%09%09%09%09put(histo, stackTrace, counter);%0A%09%09%09%7D%0A%09%09%09else %7B%0A%09%09%09%09incrementAndGet(counter);%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09@OnTimer(5000)%0A%09public static void print() %7B%0A%09%09if (size(histo) != 0) %7B%0A%09%09%09printNumberMap(%22%5Cn%5CnStacktrace Histogram for 'new URLClassLoader()'%22, histo);%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add probe for finding out where URLClassLoaders are created