comparison src/os/windows/vm/perfMemory_windows.cpp @ 10969:a837fa3d3f86

8013057: assert(_needs_gc || SafepointSynchronize::is_at_safepoint()) failed: only read at safepoint Summary: Detect mmap() commit failures in Linux and Solaris os::commit_memory() impls and call vm_exit_out_of_memory(). Add os::commit_memory_or_exit(). Also tidy up some NMT accounting and some mmap() return value checking. Reviewed-by: zgu, stefank, dholmes, dsamersoff
author dcubed
date Thu, 13 Jun 2013 11:16:38 -0700
parents 4b7cf00ccb08
children 1f4355cee9a2
comparison
equal deleted inserted replaced
10405:f2110083203d 10969:a837fa3d3f86
1 /* 1 /*
2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
56 if (mapAddress == NULL) { 56 if (mapAddress == NULL) {
57 return NULL; 57 return NULL;
58 } 58 }
59 59
60 // commit memory 60 // commit memory
61 if (!os::commit_memory(mapAddress, size)) { 61 if (!os::commit_memory(mapAddress, size, !ExecMem)) {
62 if (PrintMiscellaneous && Verbose) { 62 if (PrintMiscellaneous && Verbose) {
63 warning("Could not commit PerfData memory\n"); 63 warning("Could not commit PerfData memory\n");
64 } 64 }
65 os::release_memory(mapAddress, size); 65 os::release_memory(mapAddress, size);
66 return NULL; 66 return NULL;