Skip to content

Commit a0ecbc1

Browse files
committed
system property 'org.graalvm.visualvm.lib.jfluid.heap.mapmode' added to control MapMode
1 parent f04e47a commit a0ecbc1

File tree

1 file changed

+5
-0
lines changed
  • visualvm/libs.profiler/lib.profiler.heap/src/org/graalvm/visualvm/lib/jfluid/heap

1 file changed

+5
-0
lines changed

visualvm/libs.profiler/lib.profiler.heap/src/org/graalvm/visualvm/lib/jfluid/heap/AbstractLongMap.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,11 @@ private static MappedByteBuffer createBuffer(RandomAccessFile file, long length)
453453
}
454454

455455
private static FileChannel.MapMode computeMapMode() {
456+
String mode = System.getProperty("org.graalvm.visualvm.lib.jfluid.heap.mapmode"); // NOI18N
457+
if (mode != null) {
458+
if ("private".equals(mode)) return FileChannel.MapMode.PRIVATE; // NOI18N
459+
return FileChannel.MapMode.READ_WRITE;
460+
}
456461
if (isLinux()) return FileChannel.MapMode.PRIVATE;
457462
if (isMacOS() && isAarch64()) return FileChannel.MapMode.PRIVATE;
458463
return FileChannel.MapMode.READ_WRITE;

0 commit comments

Comments
 (0)