6424123: JVM crashes on failed 'strdup' call

Calling os::malloc()/os::strdup() and new os::strdup_check_oom() instead of ::malloc()/::strdup() for native memory tracking purpose

Reviewed-by: coleenp, ctornqvi, kvn
This commit is contained in:
Zhengyu Gu 2014-08-11 10:18:09 -07:00
parent 69e7c05210
commit 8a690a1250
20 changed files with 82 additions and 36 deletions

View file

@ -58,6 +58,7 @@
#include "runtime/mutexLocker.hpp"
#include "runtime/objectMonitor.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "runtime/os.hpp"
#include "runtime/osThread.hpp"
#include "runtime/perfMemory.hpp"
#include "runtime/sharedRuntime.hpp"
@ -378,10 +379,10 @@ void os::Aix::query_multipage_support() {
// default should be 4K.
size_t data_page_size = SIZE_4K;
{
void* p = ::malloc(SIZE_16M);
void* p = os::malloc(SIZE_16M, mtInternal);
guarantee(p != NULL, "malloc failed");
data_page_size = os::Aix::query_pagesize(p);
::free(p);
os::free(p);
}
// query default shm page size (LDR_CNTRL SHMPSIZE)