 Chromium Code Reviews
 Chromium Code Reviews Issue 7020020:
  Lower heap size limits on systems that are short of virtual memory.  (Closed) 
  Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
    
  
    Issue 7020020:
  Lower heap size limits on systems that are short of virtual memory.  (Closed) 
  Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/| OLD | NEW | 
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. | 
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without | 
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are | 
| 4 // met: | 4 // met: | 
| 5 // | 5 // | 
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright | 
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. | 
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above | 
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following | 
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided | 
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 last_idle_notification_gc_count_init_(false), | 145 last_idle_notification_gc_count_init_(false), | 
| 146 configured_(false), | 146 configured_(false), | 
| 147 is_safe_to_read_maps_(true) { | 147 is_safe_to_read_maps_(true) { | 
| 148 // Allow build-time customization of the max semispace size. Building | 148 // Allow build-time customization of the max semispace size. Building | 
| 149 // V8 with snapshots and a non-default max semispace size is much | 149 // V8 with snapshots and a non-default max semispace size is much | 
| 150 // easier if you can define it as part of the build environment. | 150 // easier if you can define it as part of the build environment. | 
| 151 #if defined(V8_MAX_SEMISPACE_SIZE) | 151 #if defined(V8_MAX_SEMISPACE_SIZE) | 
| 152 max_semispace_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE; | 152 max_semispace_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE; | 
| 153 #endif | 153 #endif | 
| 154 | 154 | 
| 155 intptr_t max_virtual = OS::MaxVirtualMemory(); | |
| 156 | |
| 157 if (max_virtual > 0) { | |
| 158 if (code_range_size_ > 0) { | |
| 
Kasper Lund
2011/06/01 08:23:49
It would be nice with a comment here that explains
 | |
| 159 code_range_size_ = Min(code_range_size_, max_virtual >> 2); | |
| 160 } | |
| 161 max_old_generation_size_ = Min(max_old_generation_size_, max_virtual >> 1); | |
| 162 } | |
| 163 | |
| 155 memset(roots_, 0, sizeof(roots_[0]) * kRootListLength); | 164 memset(roots_, 0, sizeof(roots_[0]) * kRootListLength); | 
| 156 global_contexts_list_ = NULL; | 165 global_contexts_list_ = NULL; | 
| 157 mark_compact_collector_.heap_ = this; | 166 mark_compact_collector_.heap_ = this; | 
| 158 external_string_table_.heap_ = this; | 167 external_string_table_.heap_ = this; | 
| 159 } | 168 } | 
| 160 | 169 | 
| 161 | 170 | 
| 162 intptr_t Heap::Capacity() { | 171 intptr_t Heap::Capacity() { | 
| 163 if (!HasBeenSetup()) return 0; | 172 if (!HasBeenSetup()) return 0; | 
| 164 | 173 | 
| (...skipping 5758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5923 } | 5932 } | 
| 5924 | 5933 | 
| 5925 | 5934 | 
| 5926 void ExternalStringTable::TearDown() { | 5935 void ExternalStringTable::TearDown() { | 
| 5927 new_space_strings_.Free(); | 5936 new_space_strings_.Free(); | 
| 5928 old_space_strings_.Free(); | 5937 old_space_strings_.Free(); | 
| 5929 } | 5938 } | 
| 5930 | 5939 | 
| 5931 | 5940 | 
| 5932 } } // namespace v8::internal | 5941 } } // namespace v8::internal | 
| OLD | NEW |