|
68 | 68 | import com.oracle.svm.core.annotate.AutomaticFeature;
|
69 | 69 | import com.oracle.svm.core.code.CodeInfoTable;
|
70 | 70 | import com.oracle.svm.core.heap.Heap;
|
| 71 | +import com.oracle.svm.core.jdk.Resources; |
| 72 | +import com.oracle.svm.core.jdk.resources.ResourceStorageEntry; |
71 | 73 | import com.oracle.svm.core.option.HostedOptionValues;
|
72 | 74 | import com.oracle.svm.core.reflect.ReflectionMetadataDecoder;
|
73 | 75 | import com.oracle.svm.core.util.VMError;
|
@@ -389,8 +391,9 @@ public void printCreationEnd(int imageSize, int numHeapObjects, long imageHeapSi
|
389 | 391 | String format = "%9s (%5.2f%%) for ";
|
390 | 392 | l().a(format, Utils.bytesToHuman(codeCacheSize), codeCacheSize / (double) imageSize * 100)
|
391 | 393 | .doclink("code area", "#glossary-code-area").a(":%,9d compilation units", numCompilations).println();
|
| 394 | + int numResources = Resources.singleton().resources().size(); |
392 | 395 | l().a(format, Utils.bytesToHuman(imageHeapSize), imageHeapSize / (double) imageSize * 100)
|
393 |
| - .doclink("image heap", "#glossary-image-heap").a(": %,8d objects", numHeapObjects).println(); |
| 396 | + .doclink("image heap", "#glossary-image-heap").a(":%,8d objects and %,d resources", numHeapObjects, numResources).println(); |
394 | 397 | if (debugInfoSize > 0) {
|
395 | 398 | DirectPrinter l = l().a(format, Utils.bytesToHuman(debugInfoSize), debugInfoSize / (double) imageSize * 100)
|
396 | 399 | .doclink("debug info", "#glossary-debug-info");
|
@@ -502,6 +505,16 @@ private Map<String, Long> calculateHeapBreakdown(Collection<ObjectInfo> heapObje
|
502 | 505 | classNameToSize.put(BREAKDOWN_BYTE_ARRAY_PREFIX + linkStrategy.asDocLink("reflection metadata", "#glossary-reflection-metadata"), metadataByteLength);
|
503 | 506 | remainingBytes -= metadataByteLength;
|
504 | 507 | }
|
| 508 | + long resourcesByteLength = 0; |
| 509 | + for (ResourceStorageEntry resourceList : Resources.singleton().resources().getValues()) { |
| 510 | + for (byte[] resource : resourceList.getData()) { |
| 511 | + resourcesByteLength += resource.length; |
| 512 | + } |
| 513 | + } |
| 514 | + if (resourcesByteLength > 0) { |
| 515 | + classNameToSize.put(BREAKDOWN_BYTE_ARRAY_PREFIX + linkStrategy.asDocLink("embedded resources", "#glossary-embedded-resources"), resourcesByteLength); |
| 516 | + remainingBytes -= resourcesByteLength; |
| 517 | + } |
505 | 518 | if (graphEncodingByteLength > 0) {
|
506 | 519 | classNameToSize.put(BREAKDOWN_BYTE_ARRAY_PREFIX + linkStrategy.asDocLink("graph encodings", "#glossary-graph-encodings"), graphEncodingByteLength);
|
507 | 520 | remainingBytes -= graphEncodingByteLength;
|
|
0 commit comments