diff src/share/vm/services/mallocTracker.cpp @ 20509:1ff288f0dae4

8058818: Allocation of more then 1G of memory using Unsafe.allocateMemory is still causing a fatal error on 32bit platforms Summary: The assert was firing for NMT_Off and minimal too even though the size isn't used. Reviewed-by: gtriantafill, dholmes
author coleenp
date Thu, 25 Sep 2014 07:52:32 -0400
parents 833b0f92429a
children 417e3b8d04c5
line wrap: on
line diff
--- a/src/share/vm/services/mallocTracker.cpp	Tue Sep 30 08:29:26 2014 +0000
+++ b/src/share/vm/services/mallocTracker.cpp	Thu Sep 25 07:52:32 2014 -0400
@@ -140,11 +140,6 @@
     return NULL;
   }
 
-  // Check malloc size, size has to <= MAX_MALLOC_SIZE. This is only possible on 32-bit
-  // systems, when malloc size >= 1GB, but is is safe to assume it won't happen.
-  if (size > MAX_MALLOC_SIZE) {
-    fatal("Should not use malloc for big memory block, use virtual memory instead");
-  }
   // Uses placement global new operator to initialize malloc header
   switch(level) {
     case NMT_off:
@@ -154,10 +149,12 @@
       break;
     }
     case NMT_summary: {
+      assert(size <= MAX_MALLOC_SIZE, "malloc size overrun for NMT");
       header = ::new (malloc_base) MallocHeader(size, flags);
       break;
     }
     case NMT_detail: {
+      assert(size <= MAX_MALLOC_SIZE, "malloc size overrun for NMT");
       header = ::new (malloc_base) MallocHeader(size, flags, stack);
       break;
     }