Examples of MemoryObject


Examples of org.jboss.profiler.memoryprofiler.model.MemoryObject

                    long classId = parseObjectId(path[0]);
                    MemoryClass clazz = findClass(classId);
                    currentList.addAll(getObjects(clazz));
                } else {
                    long objectId = parseObjectId(path[0]);
                    MemoryObject objectFound = findObject(objectId);
                    currentList.add(objectFound);
                }
            } else {
                if (path[i].startsWith("C"))
                {
                    long classId = parseObjectId(path[i]);
                    MemoryClass clazz = findClass(classId);
                    MemoryReferenceSummary summary = (MemoryReferenceSummary)summariesByClass.get(clazz);
                    currentList.clear();
                    if (summary!=null)
                    {
                        currentList.addAll(summary.getObjectsReferenced().values());
                    }
                } else {
                    long objectId = parseObjectId(path[i]);
                    MemoryObject objectFound = findObject(objectId);
                    MemoryClass clazz = objectFound.getMemoryClass();
                    MemoryReferenceSummary summary = (MemoryReferenceSummary)summariesByClass.get(clazz);
                    if (summary!=null)
                    {
                        // We could look for the object at summary.getObjectsReferenced()... but we would get the same result... so, just don't bother about it.
                        currentList.add(objectFound);
                    }
                }
                summariesByClass.clear();
            }

            int count=0;
            Iterator iter = currentList.iterator();
            while (iter.hasNext())
            {
                if ((count++)%100==0)
                {
                    System.out.println("Treated " + count + " references");
                }
                MemoryObject objectReference = (MemoryObject)iter.next();
                ReferenceContainer container = this.dao.selectReferences(objectReference,forward);
                if (container==null)
                {
                    continue;
                }

                Iterator referencesToIterator = container.getListOfReferences().iterator();
                while (referencesToIterator.hasNext())
                {
                    MemoryReference reference = (MemoryReference) referencesToIterator.next();
                    MemoryObject objectReferenceTo = null;
                    objectReferenceTo=reference.getObjectReferred();
                    MemoryClass memoryClazz = this.solveClassReference(objectReferenceTo);
                    if (memoryClazz==null)
                    {
                        long classId=0;
                        if (objectReferenceTo!=null)
                        {
                            classId=objectReferenceTo.getClassId();
                        }
                        System.out.println("Didn't find class for " + classId + " Reference = (" + reference.toString()+ ")");
                    }
                    MemoryReferenceSummary summary = (MemoryReferenceSummary)summariesByClass.get(memoryClazz);
                    if (summary==null)
View Full Code Here

Examples of org.jboss.profiler.memoryprofiler.model.MemoryObject

            String split[] = strMessage.split(",");
            long objectId = Long.parseLong(split[0].trim());
            long classId = Long.parseLong(split[1].trim());
            long size = Long.parseLong(split[2].trim());

            MemoryObject obj = new MemoryObject(objectId,size,classId);
            bulk.add(obj);

        }
        bulk.close();
View Full Code Here

Examples of org.jboss.profiler.memoryprofiler.model.MemoryObject

    private void countObjects()
    {
        Iterator iter = objects.iterator();
        while (iter.hasNext())
        {
            MemoryObject obj = (MemoryObject)iter.next();

            MemoryClass classFound = findClass(obj.getClassId());
            if (classFound==null)
            {
                System.out.println("Couldn't find classId=" + obj.getClassId());
            }
            else
            {
                classFound.addSize(obj.getSize());
            }
        }
    }
View Full Code Here

Examples of org.jboss.profiler.memoryprofiler.model.MemoryObject

        Iterator iter = referencesFound.iterator();

        while (iter.hasNext())
        {
            MemoryReference referenceInstance = (MemoryReference)iter.next();
            MemoryObject memoryObject = null;
            if (forward)
            {
                memoryObject = this.selectObject(referenceInstance.getReferred());
            } else
            {
View Full Code Here

Examples of org.jboss.profiler.memoryprofiler.model.MemoryObject

        ArrayList arrayList = new ArrayList();

        Iterator iter = engine.objects.iterator();
        while (iter.hasNext())
        {
            MemoryObject object = (MemoryObject)iter.next();
            if (object.getClassId() == clazz.getId())
            {
                object.setMemoryClass(clazz);
                arrayList.add(object);
            }
        }

        return arrayList;
View Full Code Here

Examples of org.jboss.profiler.memoryprofiler.model.MemoryObject

    public MemoryObject selectObject (long objectId) throws Exception
    {
        objectKey.setId(objectId);

        MemoryObject returnObject = (MemoryObject)engine.objectsSorter.binarySearchItem(engine.objects,objectKey);
        if (returnObject==null)
        {
            returnObject=selectClass(objectId);
        }

        if (returnObject!=null)
        {
            returnObject.setMemoryClass(selectClass(returnObject.getClassId()));
        }

        return returnObject;
    }
View Full Code Here

Examples of org.jboss.profiler.memoryprofiler.model.MemoryObject

        return returnObject;
    }

    private MemoryObject createObject(ResultSet rset) throws SQLException, Exception
    {
        MemoryObject memObj = new MemoryObject();
        memObj.setId(rset.getLong(1));
        memObj.setSize(rset.getLong(3));
        memObj.setClassId(rset.getLong(2));
        memObj.setMemoryClass(selectClass(memObj.getClassId()));
        return memObj;
    }
View Full Code Here

Examples of systeminformationmonitor.system.object.MemoryObject

                SystemInformationMonitorApp.getApplication();
    }

    @Override
    public void update() {
        final MemoryObject memObj = getMemoryInfo();
        threadLock.lock();
        try {
            SwingUtilities.invokeAndWait(new Runnable() {

                @Override
                public void run() {
                    sysApp = SystemInformationMonitorApp.getApplication();
                    NumberFormat nf = NumberFormat.getPercentInstance();
                    long total = memObj.getTotalMemoryLong();
                    long free = memObj.getFreeMemoryLong();
                    long used = memObj.getUsedMemoryLong();
                    double freePercent = (double) ((double) free / total) * 100;
                    double usedPercent = (double) ((double) used / total) * 100;
                    sysApp.getView().setUsedMemoryProgressBar(
                            (int) usedPercent, memObj.getActualUsed());
                    sysApp.getView().setFreeMemoryProgressBar(
                            (int) freePercent, memObj.getActualFree());
                    sysApp.getView().setTotalMemoryProgressBar(100, memObj.getTotalMemory());
                    DefaultPieDataset dataset = (DefaultPieDataset) ((PiePlot) ((ChartPanel) sysApp.getView().
                            getMemoryPieChartPanel()).getChart().getPlot()).getDataset();
                    dataset.setValue("Free Memory", (int) freePercent);
                    dataset.setValue("Used Memory", (int) usedPercent);
                }
View Full Code Here

Examples of systeminformationmonitor.system.object.MemoryObject

            threadLock.unlock();
        }
    }

    private MemoryObject getMemoryInfo() {
        MemoryObject memObj = new MemoryObject();
        try {
            Mem temp = sigar.getMem();
            memObj.setActualFree(temp.getActualFree());
            memObj.setActualUsed(temp.getActualUsed());

            memObj.setUsedMemory(temp.getUsed());
            memObj.setFreeMemory(temp.getFree());
            memObj.setTotalMemory(temp.getTotal());

            memObj.setUsedPrecentage(temp.getUsedPercent());
            memObj.setFreePrecentage(temp.getFreePercent());
        } catch (SigarException ex) {
            Logger.getLogger(Memory.class.getName()).log(Level.SEVERE, null, ex);
        }

        return memObj;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.