Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ public class AddressRangeCommittedMemoryProvider extends ChunkBasedCommittedMemo
protected static final int OUT_OF_ADDRESS_SPACE = 1;
protected static final int COMMIT_FAILED = 2;

protected static final String UNCOMMIT_FAILED_ERROR_MSG = "Failed while uncommitting memory. " +
"This error may occur if the operating system's memory mapping limit is too low (see vm.max_map_count on Linux). Please increase this limit and try again.";
private static final OutOfMemoryError NODE_ALLOCATION_FAILED = new OutOfMemoryError("Could not allocate node for free list, OS may be out of memory.");
private static final OutOfMemoryError OUT_OF_METASPACE = new OutOfMemoryError("Could not allocate a metaspace chunk because the metaspace is exhausted.");
private static final OutOfMemoryError ALIGNED_OUT_OF_ADDRESS_SPACE = new OutOfMemoryError("Could not allocate an aligned heap chunk because the heap address space is exhausted. " +
Expand Down Expand Up @@ -776,7 +778,7 @@ private static RuntimeException reportUncommitFailed(Pointer mapBegin, UnsignedW

private static RuntimeException reportUncommitFailedInterruptibly(Pointer mapBegin, UnsignedWord mappingSize) {
Log.log().string("Uncommitting ").unsigned(mappingSize).string(" bytes of unused memory at ").hex(mapBegin).string(" failed.").newline();
throw VMError.shouldNotReachHere("Uncommitting memory failed.");
throw VMError.shouldNotReachHere(UNCOMMIT_FAILED_ERROR_MSG);
}

@Uninterruptible(reason = CALLED_FROM_UNINTERRUPTIBLE_CODE, mayBeInlined = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,9 @@ public static void makeCodeMemoryExecutableWritable(CodePointer start, UnsignedW
private static void protectCodeMemory(CodePointer codeStart, UnsignedWord codeSize, int permissions) {
int result = VirtualMemoryProvider.get().protect(codeStart, codeSize, permissions);
if (result != 0) {
throw VMError.shouldNotReachHere("Failed to modify protection of code memory. This may be caused by " +
"a. a too restrictive OS-limit of allowed memory mappings (see vm.max_map_count on Linux), " +
"b. a too strict security policy if you are running on Security-Enhanced Linux (SELinux), or " +
"c. a Native Image internal error.");
throw VMError.shouldNotReachHere("Failed to modify protection of code memory. " +
"This error may occur if the operating system's memory mapping limit is too low (see vm.max_map_count on Linux). Please increase this limit and try again." +
"If you are running on Security-Enhanced Linux (SELinux), you may also need to check the configured security policy.");
}
}

Expand Down