--- a/hotspot/src/os/linux/vm/os_linux.cpp Mon Apr 29 16:36:17 2013 -0400
+++ b/hotspot/src/os/linux/vm/os_linux.cpp Mon Apr 29 11:03:49 2013 -0700
@@ -2906,9 +2906,10 @@
flags |= MAP_FIXED;
}
- // Map uncommitted pages PROT_READ and PROT_WRITE, change access
- // to PROT_EXEC if executable when we commit the page.
- addr = (char*)::mmap(requested_addr, bytes, PROT_READ|PROT_WRITE,
+ // Map reserved/uncommitted pages PROT_NONE so we fail early if we
+ // touch an uncommitted page. Otherwise, the read/write might
+ // succeed if we have enough swap space to back the physical page.
+ addr = (char*)::mmap(requested_addr, bytes, PROT_NONE,
flags, -1, 0);
if (addr != MAP_FAILED) {