changes to statistics and content of thread dump servlet

(points now more directly to performance leaks without mentioning class calls inside of sun/java calls that cannot be changed anyway)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5390 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent db6b3bf5a3
commit 13cb0916ee

@ -151,14 +151,16 @@ public class Threaddump_p {
Map<Thread,StackTraceElement[]> trace; Map<Thread,StackTraceElement[]> trace;
HashMap<String, Integer> result = new HashMap<String, Integer>(); HashMap<String, Integer> result = new HashMap<String, Integer>();
HashMap<String, ArrayList<String>> x; HashMap<String, ArrayList<String>> x;
int count;
for (int i = 0; i < stackTraces.size(); i++) { for (int i = 0; i < stackTraces.size(); i++) {
trace = stackTraces.get(i); trace = stackTraces.get(i);
x = dumpCollection(rootPath, trace, plain, stateIn); x = dumpCollection(rootPath, trace, plain, stateIn);
for (final Entry<String, ArrayList<String>> e: x.entrySet()) { for (final Entry<String, ArrayList<String>> e: x.entrySet()) {
Integer c = result.get(e.getKey()); Integer c = result.get(e.getKey());
if (c == null) result.put(e.getKey(), new Integer(1)); count = e.getValue().size();
if (c == null) result.put(e.getKey(), new Integer(count));
else { else {
c = new Integer(c.intValue() + 1); c = new Integer(c.intValue() + count);
result.put(e.getKey(), c); result.put(e.getKey(), c);
} }
} }
@ -192,6 +194,7 @@ public class Threaddump_p {
String threadtitle = tracename + "Thread= " + thread.getName() + " " + (thread.isDaemon()?"daemon":"") + " id=" + thread.getId() + " " + thread.getState().toString(); String threadtitle = tracename + "Thread= " + thread.getName() + " " + (thread.isDaemon()?"daemon":"") + " id=" + thread.getId() + " " + thread.getState().toString();
for (int i = 0; i < stackTraceElements.length; i++) { for (int i = 0; i < stackTraceElements.length; i++) {
ste = stackTraceElements[i]; ste = stackTraceElements[i];
if (ste.getClassName().startsWith("java.") || ste.getClassName().startsWith("sun.")) continue;
if (i == 0) { if (i == 0) {
line = getLine(getClassFile(classPath, ste.getClassName()), ste.getLineNumber()); line = getLine(getClassFile(classPath, ste.getClassName()), ste.getLineNumber());
} else { } else {

Loading…
Cancel
Save