Revert 8133: Lower heap size limits on systems that are short
authorerik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 8 Jun 2011 07:28:31 +0000 (07:28 +0000)
committererik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 8 Jun 2011 07:28:31 +0000 (07:28 +0000)
of virtual memory.
Review URL: http://codereview.chromium.org/7041004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8212 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/heap.cc
src/platform-posix.cc
src/platform-win32.cc
src/platform.h

index 33606e15afcaaa126897eb73bba19fdaaaf55825..8f1ad946288979ebbc790c57eddfe250646137d7 100644 (file)
@@ -153,29 +153,6 @@ Heap::Heap()
   max_semispace_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE;
 #endif
 
-  intptr_t max_virtual = OS::MaxVirtualMemory();
-
-  if (max_virtual > 0) {
-    intptr_t half = max_virtual >> 1;
-    intptr_t quarter = max_virtual >> 2;
-    // If we have limits on the amount of virtual memory we can use then we may
-    // be forced to lower the allocation limits.  We reserve one quarter of the
-    // memory for young space and off-heap data.  The rest is distributed as
-    // described below.
-    if (code_range_size_ > 0) {
-      // Reserve a quarter of the memory for the code range.  The old space
-      // heap gets the remaining half.  There is some unavoidable double
-      // counting going on here since the heap size is measured in committed
-      // virtual memory and the code range is only reserved virtual memory.
-      code_range_size_ = Min(code_range_size_, quarter);
-      max_old_generation_size_ = Min(max_old_generation_size_, half);
-    } else {
-      // Reserve three quarters of the memory for the old space heap including
-      // the executable code.
-      max_old_generation_size_ = Min(max_old_generation_size_, half + quarter);
-    }
-  }
-
   memset(roots_, 0, sizeof(roots_[0]) * kRootListLength);
   global_contexts_list_ = NULL;
   mark_compact_collector_.heap_ = this;
index 83f6c8112edf0732e4de957779e393d13d2deda3..c4b0fb8226e79e98d2a1d30a4dd565b56b569e53 100644 (file)
 namespace v8 {
 namespace internal {
 
-
-// Maximum size of the virtual memory.  0 means there is no artificial
-// limit.
-
-intptr_t OS::MaxVirtualMemory() {
-  struct rlimit limit;
-  int result = getrlimit(RLIMIT_DATA, &limit);
-  if (result != 0) return 0;
-  return limit.rlim_cur;
-}
-
-
 // ----------------------------------------------------------------------------
 // Math functions
 
index ed0e430ce70eb9972b5aa7a17db5868422bf7151..ae231563ef13a00e49d20238dd0f9f1b82bbb0c2 100644 (file)
 namespace v8 {
 namespace internal {
 
-intptr_t OS::MaxVirtualMemory() {
-  return 0;
-}
-
-
 // Test for finite value - usually defined in math.h
 int isfinite(double x) {
   return _finite(x);
index 02373792bf6cffde22c6d8d50ba0ae780a2cef59..725008a784c531c139117e5c86a35372c5fcc4fa 100644 (file)
@@ -288,10 +288,6 @@ class OS {
   // positions indicated by the members of the CpuFeature enum from globals.h
   static uint64_t CpuFeaturesImpliedByPlatform();
 
-  // Maximum size of the virtual memory.  0 means there is no artificial
-  // limit.
-  static intptr_t MaxVirtualMemory();
-
   // Returns the double constant NAN
   static double nan_value();