@@ -349,22 +349,24 @@ public void setDebugInfoTimer(Timer timer) {
349349 public void printCreationEnd (Timer creationTimer , Timer writeTimer , int imageSize , AnalysisUniverse universe , int numHeapObjects , long imageHeapSize , int codeCacheSize ,
350350 int numCompilations , int debugInfoSize ) {
351351 printStageEnd (creationTimer .getTotalTime () + writeTimer .getTotalTime ());
352- String total = bytesToHuman ("%4.2f" , imageSize );
353- long otherBytes = imageSize - codeCacheSize - imageHeapSize ;
354- l ().a ("%9s in total (%.1f%% " , total , codeCacheSize / (double ) imageSize * 100 ).doclink ("code area" , "#glossary-code-area" )
355- .a (", %.1f%% " , imageHeapSize / (double ) imageSize * 100 ).doclink ("image heap" , "#glossary-image-heap" )
356- .a (", and %.1f%% " , otherBytes / (double ) imageSize * 100 ).doclink ("other data" , "#glossary-other-data" ).a (")" ).flushln ();
357- l ().a ("%9s for code area:%,9d compilation units" , bytesToHuman ("%4.2f" , codeCacheSize ), numCompilations ).flushln ();
352+ String format = "%9s (%5.2f%%) for " ;
353+ l ().a (format , bytesToHuman (codeCacheSize ), codeCacheSize / (double ) imageSize * 100 )
354+ .doclink ("code area" , "#glossary-code-area" ).a (":%,9d compilation units" , numCompilations ).flushln ();
358355 long numInstantiatedClasses = universe .getTypes ().stream ().filter (t -> t .isInstantiated ()).count ();
359- l ().a ("%9s for image heap:%,8d classes and %,d objects" , bytesToHuman ("%4.2f" , imageHeapSize ), numInstantiatedClasses , numHeapObjects ).flushln ();
356+ l ().a (format , bytesToHuman (imageHeapSize ), imageHeapSize / (double ) imageSize * 100 )
357+ .doclink ("image heap" , "#glossary-image-heap" ).a (":%,8d classes and %,d objects" , numInstantiatedClasses , numHeapObjects ).flushln ();
360358 if (debugInfoSize > 0 ) {
361- l ().a ("%9s in debugInfo size" , bytesToHuman ("%4.2f" , debugInfoSize )). flushln ();
362- }
363- l (). a ( "%9s for other data" , bytesToHuman ( "%4.2f" , otherBytes )). flushln ();
364- if ( debugInfoTimer != null ) {
365- String debugInfoTime = String . format ( "%.1fs" , millisToSeconds ( debugInfoTimer . getTotalTime ()));
366- l (). dim (). a ( "%9s for generating debug info" , debugInfoTime ). reset () .flushln ();
359+ LinePrinter l = l ().a (format , bytesToHuman (debugInfoSize ) , debugInfoSize / ( double ) imageSize * 100 )
360+ . doclink ( "debug info" , "#glossary-debug-info" );
361+ if ( debugInfoTimer != null ) {
362+ l . a ( " generated in %.1fs" , millisToSeconds ( debugInfoTimer . getTotalTime ()));
363+ }
364+ l .flushln ();
367365 }
366+ long otherBytes = imageSize - codeCacheSize - imageHeapSize - debugInfoSize ;
367+ l ().a (format , bytesToHuman (otherBytes ), otherBytes / (double ) imageSize * 100 )
368+ .doclink ("other data" , "#glossary-other-data" ).flushln ();
369+ l ().a ("%9s in total" , bytesToHuman (imageSize )).flushln ();
368370 }
369371
370372 public void printBreakdowns (Collection <CompileTask > compilationTasks , Collection <ObjectInfo > heapObjects ) {
@@ -387,7 +389,7 @@ public void printBreakdowns(Collection<CompileTask> compilationTasks, Collection
387389 if (packagesBySize .hasNext ()) {
388390 Entry <String , Long > e = packagesBySize .next ();
389391 String className = truncateClassOrPackageName (e .getKey ());
390- codeSizePart = String .format ("%9s %s" , bytesToHuman ("%4.2f" , e .getValue ()), className );
392+ codeSizePart = String .format ("%9s %s" , bytesToHuman (e .getValue ()), className );
391393 printedCodeSizeEntries .add (e );
392394 }
393395
@@ -675,7 +677,7 @@ private static double getUsedMemory() {
675677 }
676678
677679 private static String bytesToHuman (long bytes ) {
678- return bytesToHuman ("%.2f" , bytes );
680+ return bytesToHuman ("%4 .2f" , bytes );
679681 }
680682
681683 private static String bytesToHuman (String format , long bytes ) {
0 commit comments