V8 Project
|
A set of constraints that specifies the limits of the runtime's memory use. More...
#include <v8.h>
Public Member Functions | |
ResourceConstraints () | |
void | ConfigureDefaults (uint64_t physical_memory, uint64_t virtual_memory_limit, uint32_t number_of_processors) |
Configures the constraints with reasonable default values based on the capabilities of the current device the VM is running on. More... | |
int | max_semi_space_size () const |
void | set_max_semi_space_size (int value) |
int | max_old_space_size () const |
void | set_max_old_space_size (int value) |
int | max_executable_size () const |
void | set_max_executable_size (int value) |
uint32_t * | stack_limit () const |
void | set_stack_limit (uint32_t *value) |
int | max_available_threads () const |
void | set_max_available_threads (int value) |
size_t | code_range_size () const |
void | set_code_range_size (size_t value) |
Private Attributes | |
int | max_semi_space_size_ |
int | max_old_space_size_ |
int | max_executable_size_ |
uint32_t * | stack_limit_ |
int | max_available_threads_ |
size_t | code_range_size_ |
A set of constraints that specifies the limits of the runtime's memory use.
You must set the heap size before initializing the VM - the size cannot be adjusted after the VM is initialized.
If you are using threads then you should hold the V8::Locker lock while setting the stack limit and you must set a non-default stack limit separately for each thread.
v8::ResourceConstraints::ResourceConstraints | ( | ) |
Definition at line 421 of file api.cc.
|
inline |
Definition at line 4099 of file v8.h.
Referenced by v8::SetResourceConstraints().
void v8::ResourceConstraints::ConfigureDefaults | ( | uint64_t | physical_memory, |
uint64_t | virtual_memory_limit, | ||
uint32_t | number_of_processors | ||
) |
Configures the constraints with reasonable default values based on the capabilities of the current device the VM is running on.
physical_memory | The total amount of physical memory on the current device, in bytes. |
virtual_memory_limit | The amount of virtual memory on the current device, in bytes, or zero, if there is no limit. |
number_of_processors | The number of CPUs available on the current device. |
Definition at line 429 of file api.cc.
References v8::internal::GB, v8::internal::Heap::kMaxExecutableSizeHighMemoryDevice, v8::internal::Heap::kMaxExecutableSizeHugeMemoryDevice, v8::internal::Heap::kMaxExecutableSizeLowMemoryDevice, v8::internal::Heap::kMaxExecutableSizeMediumMemoryDevice, v8::internal::kMaximalCodeRangeSize, v8::internal::Heap::kMaxOldSpaceSizeHighMemoryDevice, v8::internal::Heap::kMaxOldSpaceSizeHugeMemoryDevice, v8::internal::Heap::kMaxOldSpaceSizeLowMemoryDevice, v8::internal::Heap::kMaxOldSpaceSizeMediumMemoryDevice, v8::internal::Heap::kMaxSemiSpaceSizeHighMemoryDevice, v8::internal::Heap::kMaxSemiSpaceSizeHugeMemoryDevice, v8::internal::Heap::kMaxSemiSpaceSizeLowMemoryDevice, v8::internal::Heap::kMaxSemiSpaceSizeMediumMemoryDevice, v8::internal::kRequiresCodeRange, v8::internal::compiler::Max(), v8::MB, v8::internal::compiler::Min(), set_code_range_size(), set_max_available_threads(), set_max_executable_size(), set_max_old_space_size(), and set_max_semi_space_size().
Referenced by v8::Shell::Main().
|
inline |
Definition at line 4094 of file v8.h.
Referenced by v8::SetResourceConstraints().
|
inline |
Definition at line 4089 of file v8.h.
Referenced by v8::SetResourceConstraints().
|
inline |
Definition at line 4087 of file v8.h.
Referenced by v8::SetResourceConstraints().
|
inline |
Definition at line 4085 of file v8.h.
Referenced by v8::SetResourceConstraints().
|
inline |
Definition at line 4100 of file v8.h.
Referenced by ConfigureDefaults().
|
inline |
Definition at line 4096 of file v8.h.
Referenced by ConfigureDefaults().
|
inline |
Definition at line 4090 of file v8.h.
Referenced by ConfigureDefaults().
|
inline |
Definition at line 4088 of file v8.h.
Referenced by ConfigureDefaults().
|
inline |
Definition at line 4086 of file v8.h.
Referenced by ConfigureDefaults().
|
inline |
|
inline |
Definition at line 4091 of file v8.h.
Referenced by v8::SetResourceConstraints().