v8  6.8.275 (node 10.15.3)
V8 is Google's open source JavaScript engine
ResourceConstraints Class Reference

#include <v8.h>

Public Member Functions

 ResourceConstraints ()
 
void ConfigureDefaults (uint64_t physical_memory, uint64_t virtual_memory_limit)
 
 V8_DEPRECATE_SOON ("Use max_semi_space_size_in_kb()", size_t max_semi_space_size())
 
 V8_DEPRECATE_SOON ("Use set_max_semi_space_size_in_kb(size_t limit_in_kb)", void set_max_semi_space_size(size_t limit_in_mb))
 
size_t max_semi_space_size_in_kb () const
 
void set_max_semi_space_size_in_kb (size_t limit_in_kb)
 
size_t max_old_space_size () const
 
void set_max_old_space_size (size_t limit_in_mb)
 
 V8_DEPRECATE_SOON ("max_executable_size_ is subsumed by max_old_space_size_", size_t max_executable_size() const)
 
 V8_DEPRECATE_SOON ("max_executable_size_ is subsumed by max_old_space_size_", void set_max_executable_size(size_t limit_in_mb))
 
uint32_t * stack_limit () const
 
void set_stack_limit (uint32_t *value)
 
size_t code_range_size () const
 
void set_code_range_size (size_t limit_in_mb)
 
size_t max_zone_pool_size () const
 
void set_max_zone_pool_size (size_t bytes)
 

Detailed Description

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.

The arguments for set_max_semi_space_size, set_max_old_space_size, set_max_executable_size, set_code_range_size specify limits in MB.

The argument for set_max_semi_space_size_in_kb is in KB.

Definition at line 6287 of file v8.h.

Constructor & Destructor Documentation

◆ ResourceConstraints()

Member Function Documentation

◆ code_range_size()

size_t code_range_size ( ) const
inline

Definition at line 6340 of file v8.h.

◆ ConfigureDefaults()

void ConfigureDefaults ( uint64_t  physical_memory,
uint64_t  virtual_memory_limit 
)

Configures the constraints with reasonable default values based on the capabilities of the current device the VM is running on.

Parameters
physical_memoryThe total amount of physical memory on the current device, in bytes.
virtual_memory_limitThe amount of virtual memory on the current device, in bytes, or zero, if there is no limit.

◆ max_old_space_size()

size_t max_old_space_size ( ) const
inline

Definition at line 6325 of file v8.h.

◆ max_semi_space_size_in_kb()

size_t max_semi_space_size_in_kb ( ) const
inline

Definition at line 6316 of file v8.h.

◆ max_zone_pool_size()

size_t max_zone_pool_size ( ) const
inline

Definition at line 6344 of file v8.h.

◆ set_code_range_size()

void set_code_range_size ( size_t  limit_in_mb)
inline

Definition at line 6341 of file v8.h.

◆ set_max_old_space_size()

void set_max_old_space_size ( size_t  limit_in_mb)
inline

Definition at line 6326 of file v8.h.

◆ set_max_semi_space_size_in_kb()

void set_max_semi_space_size_in_kb ( size_t  limit_in_kb)
inline

Definition at line 6321 of file v8.h.

◆ set_max_zone_pool_size()

void set_max_zone_pool_size ( size_t  bytes)
inline

Definition at line 6345 of file v8.h.

◆ set_stack_limit()

void set_stack_limit ( uint32_t *  value)
inline

Definition at line 6339 of file v8.h.

◆ stack_limit()

uint32_t* stack_limit ( ) const
inline

Definition at line 6337 of file v8.h.

◆ V8_DEPRECATE_SOON() [1/4]

V8_DEPRECATE_SOON ( "max_executable_size_ is subsumed by max_old_space_size_"  ,
size_t max_executable_size() const   
)
inline

Definition at line 6329 of file v8.h.

◆ V8_DEPRECATE_SOON() [2/4]

V8_DEPRECATE_SOON ( "max_executable_size_ is subsumed by max_old_space_size_"  ,
void   set_max_executable_sizesize_t limit_in_mb 
)
inline

Definition at line 6333 of file v8.h.

◆ V8_DEPRECATE_SOON() [3/4]

V8_DEPRECATE_SOON ( "Use max_semi_space_size_in_kb()"  ,
size_t   max_semi_space_size() 
)
inline

Definition at line 6304 of file v8.h.

◆ V8_DEPRECATE_SOON() [4/4]

V8_DEPRECATE_SOON ( "Use set_max_semi_space_size_in_kb(size_t limit_in_kb)"  ,
void   set_max_semi_space_sizesize_t limit_in_mb 
)
inline

Definition at line 6310 of file v8.h.


The documentation for this class was generated from the following file: