Package org.netbeans.lib.profiler.heap

Examples of org.netbeans.lib.profiler.heap.Instance


    private void updateKnownMap(Cluster cluster) {
        RefSet marked = cluster.objects;
        for(Long id: marked.ones()) {
            if (knownRefs.getAndSet(id, true)) {
                Instance i = heap.getInstanceByID(id);
                sharedErrorMargin += i.getSize();
                if (!sharedRefs.getAndSet(id, true)) {
                    sharedErrorMargin += i.getSize();
                    sharedSummary.accumulate(i);
                }
            }
        }
    }
View Full Code Here


                if (details.objects.getAndSet(id, true)) {
                    continue;
                }

                Instance i = heap.getInstanceByID(id);
                if (blacklist.contains(i.getJavaClass().getName())) {
                    continue;
                }

                ++count;

                @SuppressWarnings("unused")
                String type = i.getJavaClass().getName();

                if (!accountShared || sharedRefs.get(i.getInstanceId())) {
                    details.summary.accumulate(i);
                }

                if (i instanceof ObjectArrayInstance) {
                    ObjectArrayInstance array = (ObjectArrayInstance) i;
                    if (!isBlackListedArray(array.getJavaClass())) {
                        for(Long ref: array.getValueIDs()) {
                            if (ref != 0) {
                                // early check to avoid needless instantiation
                                if (!ignoreRefs.get(ref) && !details.objects.get(ref)) {
                                    queue.set(ref, true);
                                }
                            }
                        }
                    }
                }
                else {
                    for(FieldValue f: i.getFieldValues()) {
                        @SuppressWarnings("unused")
                        String fieldName = f.getField().getName();
                        if (f instanceof ObjectFieldValue) {
                            ObjectFieldValue of = (ObjectFieldValue) f;
                            if (!isBlackListed(of.getField())) {
View Full Code Here

    private final class DeepPathListener implements PathListener {
        @Override
        public void onPath(Instance root, String path, Instance shared) {
            PathStep[] chain = HeapPath.parsePath(path, true);
            StringBuilder sb = new StringBuilder();
            Instance o = root;
            for(int i = 0; i != chain.length; ++i) {
                if (chain[i] instanceof TypeFilterStep) {
                    continue;
                }
                sb.append("(" + shortName(o.getJavaClass().getName()) + ")");
                try {
                Move m = chain[i].track(o).next();
                sb.append(m.pathSpec);
                o = m.instance;
            }
View Full Code Here

    }
   
    public static String explainPath(Instance root, String path) {
        PathStep[] chain = HeapPath.parsePath(path, true);
        StringBuilder sb = new StringBuilder();
        Instance o = root;
        for(int i = 0; i != chain.length; ++i) {
            if (chain[i] instanceof TypeFilterStep) {
                continue;
            }
            sb.append("(" + shortName(o.getJavaClass().getName()) + ")");
            try {
                Move m = chain[i].track(o).next();
                sb.append(m.pathSpec);
                o = m.instance;
            }
View Full Code Here

        public Instance nextInstance() {
            if (nextEntity == null) {
                throw new NoSuchElementException();
            }
            Instance e = nextEntity;
            seek();
            return e;
        }
View Full Code Here

        for(PathStep step: steps) {
            for(Instance i: active) {
                Iterator<Instance> it = step.walk(i);
                while(it.hasNext()) {
                    Instance sub = it.next();
                    if (sub != null) {
                        next.add(sub);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.netbeans.lib.profiler.heap.Instance

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.