Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ impl V8HeapPolicyConfig {

/// Default number of requests between V8 heap checks.
fn def_req_interval() -> Option<u64> {
Some(65_536)
Some(4_096)
}

/// Default wall-clock interval between V8 heap checks.
fn def_time_interval() -> Option<Duration> {
Some(Duration::from_secs(30))
Some(Duration::from_secs(5))
}

/// Default heap fill fraction that triggers a GC.
Expand Down Expand Up @@ -413,10 +413,10 @@ mod tests {
fn v8_heap_policy_defaults_when_omitted() {
let config: ConfigFile = toml::from_str("").unwrap();

assert_eq!(config.v8_heap_policy.heap_check_request_interval, Some(65_536));
assert_eq!(config.v8_heap_policy.heap_check_request_interval, Some(4_096));
assert_eq!(
config.v8_heap_policy.heap_check_time_interval,
Some(Duration::from_secs(30))
Some(Duration::from_secs(5))
);
assert_eq!(config.v8_heap_policy.heap_gc_trigger_fraction, 0.67);
assert_eq!(config.v8_heap_policy.heap_retire_fraction, 0.75);
Expand Down
29 changes: 21 additions & 8 deletions crates/core/src/host/host_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1423,12 +1423,25 @@ where
.data_size_blob_store_bytes_used_by_blobs
.remove_label_values(db);
let _ = WORKER_METRICS.wasm_memory_bytes.remove_label_values(db);
let _ = WORKER_METRICS.v8_total_heap_size_bytes.remove_label_values(db);
let _ = WORKER_METRICS.v8_total_physical_size_bytes.remove_label_values(db);
let _ = WORKER_METRICS.v8_used_global_handles_size_bytes.remove_label_values(db);
let _ = WORKER_METRICS.v8_used_heap_size_bytes.remove_label_values(db);
let _ = WORKER_METRICS.v8_heap_size_limit_bytes.remove_label_values(db);
let _ = WORKER_METRICS.v8_external_memory_bytes.remove_label_values(db);
let _ = WORKER_METRICS.v8_native_contexts.remove_label_values(db);
let _ = WORKER_METRICS.v8_detached_contexts.remove_label_values(db);
let worker_kind = crate::host::v8::V8_WORKER_KIND_INSTANCE_LANE;
let _ = WORKER_METRICS
.v8_total_heap_size_bytes
.remove_label_values(db, worker_kind);
let _ = WORKER_METRICS
.v8_total_physical_size_bytes
.remove_label_values(db, worker_kind);
let _ = WORKER_METRICS
.v8_used_global_handles_size_bytes
.remove_label_values(db, worker_kind);
let _ = WORKER_METRICS
.v8_used_heap_size_bytes
.remove_label_values(db, worker_kind);
let _ = WORKER_METRICS
.v8_heap_size_limit_bytes
.remove_label_values(db, worker_kind);
let _ = WORKER_METRICS
.v8_external_memory_bytes
.remove_label_values(db, worker_kind);
let _ = WORKER_METRICS.v8_native_contexts.remove_label_values(db, worker_kind);
let _ = WORKER_METRICS.v8_detached_contexts.remove_label_values(db, worker_kind);
}
Loading
Loading