Clear the ThreadLocal after finishing with a method to keep from hanging onto the Stack and thereby
the Stack's classloader from that thread git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6024 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -158,6 +158,11 @@ public class MethodProfiler
|
|||||||
long elapsed = nanos - method.entryTime;
|
long elapsed = nanos - method.entryTime;
|
||||||
recordTime(method.fullName(), (double)elapsed / 1000000);
|
recordTime(method.fullName(), (double)elapsed / 1000000);
|
||||||
method.name = null;
|
method.name = null;
|
||||||
|
// Clear the ThreadLocal after we've profiled our whole stack to prevent our class loader
|
||||||
|
// from hanging around
|
||||||
|
if (_stack.get().size() == 0) {
|
||||||
|
_stack.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user