5757 *
5858 * Virtual memory tracking makes the assumption that commits within a reserved region happen neatly.
5959 * There will never be overlapping commits and the size requested to be committed/uncommitted is
60- * exactly the size committed/uncommitted. In Hotspot, this assumption is not made, and an internal model
61- * of virtual memory is maintained. However, this assumption currently works in SubstrateVM because only
62- * the heap uses virtual memory, and it always neatly allocates and deallocates chunks.
60+ * exactly the size committed/uncommitted. In Hotspot, this assumption is not made, and an internal
61+ * model of virtual memory is maintained. However, this assumption currently works in SubstrateVM
62+ * because only the heap uses virtual memory, and it always neatly allocates and deallocates chunks.
6363 */
6464public class NativeMemoryTracking {
6565 private static final UnsignedWord ALIGNMENT = WordFactory .unsigned (16 );
@@ -314,6 +314,7 @@ private void printStatistics() {
314314 System .out .println (generateReportString ());
315315 }
316316 }
317+
317318 public String generateReportString () {
318319
319320 StringBuilder stringBuilder = new StringBuilder (3000 );
@@ -328,9 +329,9 @@ public String generateReportString() {
328329 stringBuilder .append ("\t " ).append ("(malloc=" ).append (getTotalMallocMemory () / KB ).append ("KB, count=" ).append (getTotalMallocCount ()).append (")" ).append ("\n " );
329330 stringBuilder .append ("\t " ).append ("(peak malloc=" ).append (getPeakTotalMallocMemory () / KB ).append ("KB, count at peak=" ).append (getCountAtPeakTotalMallocMemory ()).append (")" ).append ("\n " );
330331 stringBuilder .append ("\t " ).append ("(mmap: reserved=" ).append (getTotalReservedVirtualMemory () / KB ).append ("KB, committed=" ).append (getTotalCommittedVirtualMemory () / KB ).append ("KB)" )
331- .append ("\n " );
332+ .append ("\n " );
332333 stringBuilder .append ("\t " ).append ("(mmap: peak reserved=" ).append (getPeakTotalReservedVirtualMemory () / KB ).append ("KB, peak committed=" ).append (getPeakTotalCommittedVirtualMemory () / KB )
333- .append ("KB)" ).append ("\n " );
334+ .append ("KB)" ).append ("\n " );
334335
335336 for (int i = 0 ; i < NmtCategory .values ().length ; i ++) {
336337 NmtCategory category = NmtCategory .values ()[i ];
@@ -340,11 +341,11 @@ public String generateReportString() {
340341 stringBuilder .append ("\t " ).append ("(reserved=" ).append (reserved ).append ("KB, committed=" ).append (committed ).append ("KB)" ).append ("\n " );
341342 stringBuilder .append ("\t " ).append ("(malloc=" ).append (getMallocMemory (category ) / KB ).append ("KB, count=" ).append (getMallocCount (category )).append (")" ).append ("\n " );
342343 stringBuilder .append ("\t " ).append ("(peak malloc=" ).append (getPeakMallocMemory (category ) / KB ).append ("KB, count at peak=" ).append (getCountAtPeakMallocMemory (category )).append (")" )
343- .append ("\n " );
344+ .append ("\n " );
344345 stringBuilder .append ("\t " ).append ("(mmap: reserved=" ).append (getReservedVirtualMemory (category ) / KB ).append ("KB, committed=" ).append (getCommittedVirtualMemory (category ) / KB )
345- .append ("KB)" ).append ("\n " );
346+ .append ("KB)" ).append ("\n " );
346347 stringBuilder .append ("\t " ).append ("(mmap: peak reserved=" ).append (getPeakReservedVirtualMemory (category ) / KB ).append ("KB, peak committed=" )
347- .append (getPeakCommittedVirtualMemory (category ) / KB ).append ("KB)" ).append ("\n " );
348+ .append (getPeakCommittedVirtualMemory (category ) / KB ).append ("KB)" ).append ("\n " );
348349 }
349350 return stringBuilder .toString ();
350351 }
0 commit comments