Package org.jboss.profiler.model

Examples of org.jboss.profiler.model.JBPMemoryCount


        TreeSet setMemory = null;

        // para ordenar pelo maior tempo
        setMemory = new TreeSet(new Comparator() {
            public int compare(Object o1, Object o2) {
                JBPMemoryCount s1 = (JBPMemoryCount) o1;
                JBPGenericCount s2 = (JBPGenericCount) o2;
                int x = s2.getCount() - s1.getCount();
                if (x != 0) {
                    return x;
                } else if (((JBPClass) s1.getReferencedObject()).getName() != null
                        && ((JBPClass) s2.getReferencedObject()).getName() != null) {
                    return ((JBPClass) s1.getReferencedObject()).getName()
                            .compareTo(
                                    ((JBPClass) s2.getReferencedObject())
                                            .getName());
                } else {
                    return ((JBPClass) s1.getReferencedObject()).getClassID()
                            - ((JBPClass) s2.getReferencedObject())
                                    .getClassID();
                }
            }
        });

        HashMap hashMemory = count.createConsolidatedObjects();
        setMemory.addAll(hashMemory.values());

        printLevel(out, level);
        out.println("<memory>");

        Iterator iter = setMemory.iterator();
        while (iter.hasNext()) {
            JBPMemoryCount iterCount = (JBPMemoryCount) iter.next();
            JBPClass spyClass = (JBPClass) iterCount.getReferencedObject();
            for (int i = 0; i <= level; i++) {
                out.print(IDENT_ON_LEVEL);
            }
            out.println("<memoryItem instanceOf=\"" + spyClass.getName()
                    + "\" instances=\"" + iterCount.getCount() + "\" bytes=\""
                    + iterCount.getSize() + "\"" + " releasedInstances=\""
                    + iterCount.getCountRelease() + "\" releasedBytes=\""
                    + iterCount.getReleasedSize() + "\"/>");

        }

        for (int i = 0; i < level; i++) {
            out.print(IDENT_ON_LEVEL);
View Full Code Here


        }

        long bytes=0;
        long releasedBytes=0;
        while (iter.hasNext()) {
            JBPMemoryCount memoryCount = (JBPMemoryCount)iter.next();
            bytes += memoryCount.getSize();
            releasedBytes += memoryCount.getReleasedSize();
        }

        summary.addProcess(pid);
        summary.setBytes(summary.getBytes() + bytes);
        summary.setReleasedBytes(summary.getBytes() + releasedBytes);
View Full Code Here

TOP

Related Classes of org.jboss.profiler.model.JBPMemoryCount

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.