v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::MemoryBalancer Class Reference

#include <memory-balancer.h>

Collaboration diagram for v8::internal::MemoryBalancer:

Classes

class  SmoothedBytesAndDuration
 

Public Member Functions

 MemoryBalancer (Heap *heap, base::TimeTicks startup_time)
 
void UpdateAllocationRate (size_t major_allocation_bytes, base::TimeDelta major_allocation_duration)
 
void UpdateGCSpeed (size_t major_gc_bytes, base::TimeDelta major_gc_duration)
 
void HeartbeatUpdate ()
 
void RecomputeLimits (size_t embedder_allocation_limit, base::TimeTicks time)
 

Private Member Functions

void RefreshLimit ()
 
void PostHeartbeatTask ()
 

Private Attributes

Heapheap_
 
size_t live_memory_after_gc_ = 0
 
size_t embedder_allocation_limit_ = 0
 
std::optional< SmoothedBytesAndDurationmajor_allocation_rate_
 
std::optional< SmoothedBytesAndDurationmajor_gc_speed_
 
size_t last_measured_memory_ = 0
 
base::TimeTicks last_measured_at_
 
bool heartbeat_task_started_ = false
 

Static Private Attributes

static constexpr double kMajorAllocationDecayRate = 0.95
 
static constexpr double kMajorGCDecayRate = 0.5
 

Detailed Description

Definition at line 23 of file memory-balancer.h.

Constructor & Destructor Documentation

◆ MemoryBalancer()

v8::internal::MemoryBalancer::MemoryBalancer ( Heap * heap,
base::TimeTicks startup_time )

Definition at line 13 of file memory-balancer.cc.

Member Function Documentation

◆ HeartbeatUpdate()

void v8::internal::MemoryBalancer::HeartbeatUpdate ( )

Definition at line 83 of file memory-balancer.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PostHeartbeatTask()

void v8::internal::MemoryBalancer::PostHeartbeatTask ( )
private

Definition at line 99 of file memory-balancer.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RecomputeLimits()

void v8::internal::MemoryBalancer::RecomputeLimits ( size_t embedder_allocation_limit,
base::TimeTicks time )

Definition at line 16 of file memory-balancer.cc.

Here is the call graph for this function:

◆ RefreshLimit()

void v8::internal::MemoryBalancer::RefreshLimit ( )
private

Definition at line 26 of file memory-balancer.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateAllocationRate()

void v8::internal::MemoryBalancer::UpdateAllocationRate ( size_t major_allocation_bytes,
base::TimeDelta major_allocation_duration )

Definition at line 71 of file memory-balancer.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateGCSpeed()

void v8::internal::MemoryBalancer::UpdateGCSpeed ( size_t major_gc_bytes,
base::TimeDelta major_gc_duration )

Definition at line 60 of file memory-balancer.cc.

Here is the call graph for this function:

Member Data Documentation

◆ embedder_allocation_limit_

size_t v8::internal::MemoryBalancer::embedder_allocation_limit_ = 0
private

Definition at line 74 of file memory-balancer.h.

◆ heap_

Heap* v8::internal::MemoryBalancer::heap_
private

Definition at line 59 of file memory-balancer.h.

◆ heartbeat_task_started_

bool v8::internal::MemoryBalancer::heartbeat_task_started_ = false
private

Definition at line 84 of file memory-balancer.h.

◆ kMajorAllocationDecayRate

double v8::internal::MemoryBalancer::kMajorAllocationDecayRate = 0.95
staticconstexprprivate

Definition at line 53 of file memory-balancer.h.

◆ kMajorGCDecayRate

double v8::internal::MemoryBalancer::kMajorGCDecayRate = 0.5
staticconstexprprivate

Definition at line 54 of file memory-balancer.h.

◆ last_measured_at_

base::TimeTicks v8::internal::MemoryBalancer::last_measured_at_
private

Definition at line 83 of file memory-balancer.h.

◆ last_measured_memory_

size_t v8::internal::MemoryBalancer::last_measured_memory_ = 0
private

Definition at line 82 of file memory-balancer.h.

◆ live_memory_after_gc_

size_t v8::internal::MemoryBalancer::live_memory_after_gc_ = 0
private

Definition at line 63 of file memory-balancer.h.

◆ major_allocation_rate_

std::optional<SmoothedBytesAndDuration> v8::internal::MemoryBalancer::major_allocation_rate_
private

Definition at line 77 of file memory-balancer.h.

◆ major_gc_speed_

std::optional<SmoothedBytesAndDuration> v8::internal::MemoryBalancer::major_gc_speed_
private

Definition at line 78 of file memory-balancer.h.


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