Package org.jboss.profiler.filecollection

Examples of org.jboss.profiler.filecollection.BulkAdd


        // ignore the first line - description about the file itself
        reader.readLine();

        int line = 0;
        String strMessage = null;
        BulkAdd bulkAdd = this.references.createBulkAdd();
        MemoryReference referenceTmp = new MemoryReference();
        while ((strMessage = reader.readLine()) != null) {
            if ((line++) % 50000 == 0) {
                System.out.println("Read " + line + " references, maxMemory= " + Runtime.getRuntime().maxMemory() + ", freeMemory=" + Runtime.getRuntime().freeMemory() + " current=" + Runtime.getRuntime().totalMemory());
            }
            String split[] = strMessage.split(",");

            long referencer = 0;
            long referenced = 0;
            boolean isThread = false;

            if (split[0].startsWith("Thread")) {
                referencer = Long.parseLong(split[0].substring(6));
                //System.out.println(split[0] + " was converted into " + referencer);
                isThread = true;
            } else {
                referencer = Long.parseLong(split[0]);
            }

            referenced = Long.parseLong(split[1]);

            referenceTmp.setReferee(referencer);
            referenceTmp.setReferred(referenced);
            referenceTmp.setThreadReference(isThread);
            bulkAdd.add(referenceTmp);
        }

        bulkAdd.close();

        /*for (int i=0;i<5000;i++)
        {
            MemoryReference ref =(MemoryReference) this.references.get(i);
            System.out.println("ref = " + ref);
View Full Code Here


        reader.readLine(); // ignore first line

        int line = 0;
        String strMessage = null;
        BulkAdd bulk = objects.createBulkAdd();
        while ((strMessage = reader.readLine()) != null) {
            if ((line++) % 10000 == 0) {
                System.out.println("Read " + line + " objects, maxMemory= " + Runtime.getRuntime().maxMemory() + ", freeMemory=" + Runtime.getRuntime().freeMemory() + " current=" + Runtime.getRuntime().totalMemory());
            }
            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();

        objectsSorter.sort(objects);
    }
View Full Code Here

TOP

Related Classes of org.jboss.profiler.filecollection.BulkAdd

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.