Skip to content

Commit 0fecf52

Browse files
style
1 parent 692ef38 commit 0fecf52

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/HeapChunkProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ UnalignedHeader produceUnalignedChunk(UnsignedWord objectSize) {
251251
NativeMemoryTracking.singleton().trackReserve(chunkSize.rawValue(), NmtCategory.JavaHeap);
252252
NativeMemoryTracking.singleton().trackCommit(chunkSize.rawValue(), NmtCategory.JavaHeap);
253253

254-
255254
UnalignedHeapChunk.initialize(result, chunkSize);
256255
assert objectSize.belowOrEqual(HeapChunk.availableObjectMemory(result)) : "UnalignedHeapChunk insufficient for requested object";
257256

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/HeapImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,15 +482,16 @@ public long getImageHeapSize() {
482482
ImageHeapSizeVisitor visitor = new ImageHeapSizeVisitor();
483483
if (imageHeapSize == -1) {
484484
for (ImageHeapInfo info = firstImageHeapInfo; info != null; info = info.next) {
485-
ImageHeapWalker.walkRegions(info,visitor);
485+
ImageHeapWalker.walkRegions(info, visitor);
486486
}
487487
imageHeapSize = visitor.size;
488488
}
489489
return imageHeapSize;
490490
}
491491

492492
private static class ImageHeapSizeVisitor implements MemoryWalker.ImageHeapRegionVisitor, ObjectVisitor {
493-
long size;
493+
long size;
494+
494495
@Override
495496
public <T> boolean visitNativeImageHeapRegion(T region, MemoryWalker.NativeImageHeapRegionAccess<T> access) {
496497
if (!access.isWritable(region) && !access.consistsOfHugeObjects(region)) {

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/events/EveryChunkNativePeriodicEvents.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ private static void emitNmtPeakEvents() {
126126

127127
long totalPeakMalloc = NativeMemoryTracking.singleton().getPeakTotalMallocMemory();
128128
long totalPeakCommitted = NativeMemoryTracking.singleton().getPeakTotalCommittedVirtualMemory();
129-
long totalPeakReserved = NativeMemoryTracking.singleton().getPeakTotalReservedVirtualMemory();;
129+
long totalPeakReserved = NativeMemoryTracking.singleton().getPeakTotalReservedVirtualMemory();
130+
;
130131
nmtTotalPeakEvent.peakCommitted = totalPeakCommitted + totalPeakMalloc;
131132
nmtTotalPeakEvent.peakReserved = totalPeakReserved + totalPeakMalloc;
132133
nmtTotalPeakEvent.countAtPeak = NativeMemoryTracking.singleton().getCountAtPeakTotalMallocMemory();

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/nmt/NativeMemoryTracking.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
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
*/
6464
public 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

Comments
 (0)