Package profiler.utils

Examples of profiler.utils.IObjectProfileNode


    final StringBuilder sb = new StringBuilder();

    for( int p = 0, pLimit = node.pathlength(); p < pLimit; ++p )
      sb.append( "  " );

    final IObjectProfileNode root = node.root();
    final IObjectProfileNode[] children = node.children();

    double sizeInMB = ProfileUtils.mb( node.size() );

    sb.append( String.format( "%.2f", sizeInMB ) );
    if( node != root ) // root node is always 100% of the overall size
    {
      double percent = (double) node.size() / root.size();

      if( percent <= memPercentageLimit )
        return;

      sb.append( " (" );
      sb.append( String.format( "%2.1f%%", 100 * percent ) );
      sb.append( ")" );
    }

    sb.append( " -> " );

    String name = node.name();
    final int lastDot = name.lastIndexOf( '.' );
    if( lastDot >= 0 )
      name = name.substring( lastDot + 1 );

    sb.append( name );

    if( node.object() != null ) // skip shell pseudo-nodes
    {
      if( node.name().endsWith( "#table" ) || node.name().endsWith( "#elementData" ) ) {
        IObjectProfileNode shell = null;
        int n = children.length - 1;
        for( int i = n; i >= 0; i-- ) {
          shell = children[i];
          if( shell.object() == null )
            break;
        }
        int size = node.size() - shell.size();
        double avg = (double) size / n;

        sb.append( " children: " + n + " avg: " + avg + " " + shell.name() + " "
            + ProfileUtils.mb( shell.size() ) );
      }
      else {
        sb.append( " : " );
        sb.append( ObjectProfiler.typeName( node.object().getClass(), true ) );

View Full Code Here


    case KB_VERBOSE:
      obj = kb;
      // Fall through
    case ALL_VERBOSE:
      System.out.println( header );
      IObjectProfileNode profile = ObjectProfiler.profile( obj );
      print( profile );
      mem = profile.size();
      for( IObjectProfileNode node : profile.children() ) {
        if( node.object() != null && node.object().equals( ATermUtils.getFactory() ) ) {
          mem -= node.size();
          break;
        }
      } 
View Full Code Here

TOP

Related Classes of profiler.utils.IObjectProfileNode

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.