Merge pull request #72 from bnema/fix/remove-memory-kill-threshold
fix(perf): remove memory kill threshold
13 files · +55 -157
M docs/CONFIG.md +6 -10
| @@ -521,13 +521,12 @@ Performance profiles provide preset configurations for WebKitGTK tuning. These s | |||
| 521 | 521 | | Setting | default | lite | max | | |
| 522 | 522 | |---------|---------|------|-----| | |
| 523 | 523 | | Skia CPU threads | unset | 2 | `NumCPU()/2` (min 4) | | |
| 524 | - | | Skia GPU threads | unset | unset | 2 | | |
| 525 | - | | Web process memory (MB) | unset | 512 | 2048 | | |
| 526 | - | | Network process memory (MB) | unset | 256 | 512 | | |
| 527 | - | | Conservative threshold | unset | 0.25 | 0.5 | | |
| 528 | - | | Strict threshold | unset | 0.4 | 0.7 | | |
| 529 | - | | Kill threshold | unset | 0.8 | unset (never) | | |
| 530 | - | | WebView pool prewarm | 4 | 2 | 8 | | |
| 524 | + | | Skia GPU threads | unset | unset | scales with VRAM | | |
| 525 | + | | Web process memory (MB) | unset | 768 | unset | | |
| 526 | + | | Network process memory (MB) | unset | 384 | unset | | |
| 527 | + | | Conservative threshold | unset | 0.25 | unset | | |
| 528 | + | | Strict threshold | unset | 0.4 | unset | | |
| 529 | + | | WebView pool prewarm | 4 | 2 | scales with RAM | | |
| 531 | 530 | ||
| 532 | 531 | **Example:** | |
| 533 | 532 | ```toml | |
| @@ -557,12 +556,10 @@ When `profile = "custom"`, you can configure individual tuning options: | |||
| 557 | 556 | | `performance.web_process_memory_poll_interval_sec` | float | `0` | Memory check interval (0=WebKit default: 30s) | | |
| 558 | 557 | | `performance.web_process_memory_conservative_threshold` | float | `0` | Conservative cleanup threshold (0=unset) | | |
| 559 | 558 | | `performance.web_process_memory_strict_threshold` | float | `0` | Strict cleanup threshold (0=unset) | | |
| 560 | - | | `performance.web_process_memory_kill_threshold` | float | `-1` | Process kill threshold (-1=unset, 0=never kill) | | |
| 561 | 559 | | `performance.network_process_memory_limit_mb` | int | `0` | Network process memory limit in MB | | |
| 562 | 560 | | `performance.network_process_memory_poll_interval_sec` | float | `0` | Network memory check interval | | |
| 563 | 561 | | `performance.network_process_memory_conservative_threshold` | float | `0` | Network conservative threshold | | |
| 564 | 562 | | `performance.network_process_memory_strict_threshold` | float | `0` | Network strict threshold | | |
| 565 | - | | `performance.network_process_memory_kill_threshold` | float | `-1` | Network process kill threshold | | |
| 566 | 563 | | `performance.webview_pool_prewarm_count` | int | `4` | WebViews to pre-create at startup | | |
| 567 | 564 | | `performance.zoom_cache_size` | int | `256` | Domain zoom levels to cache | | |
| 568 | 565 | ||
| @@ -579,7 +576,6 @@ skia_gpu_painting_threads = 2 | |||
| 579 | 576 | web_process_memory_limit_mb = 1024 | |
| 580 | 577 | web_process_memory_conservative_threshold = 0.4 | |
| 581 | 578 | web_process_memory_strict_threshold = 0.6 | |
| 582 | - | web_process_memory_kill_threshold = -1 # Never kill | |
| 583 | 579 | ||
| 584 | 580 | # WebView pool | |
| 585 | 581 | webview_pool_prewarm_count = 6 | |
| @@ -521,13 +521,12 @@ Performance profiles provide preset configurations for WebKitGTK tuning. These s | |||||
| 521 | | Setting | default | lite | max | | 521 | | Setting | default | lite | max | | ||
| 522 | |---------|---------|------|-----| | 522 | |---------|---------|------|-----| | ||
| 523 | | Skia CPU threads | unset | 2 | `NumCPU()/2` (min 4) | | 523 | | Skia CPU threads | unset | 2 | `NumCPU()/2` (min 4) | | ||
| 524 | - | | Skia GPU threads | unset | unset | 2 | | 524 | + | | Skia GPU threads | unset | unset | scales with VRAM | |
| 525 | - | | Web process memory (MB) | unset | 512 | 2048 | | 525 | + | | Web process memory (MB) | unset | 768 | unset | |
| 526 | - | | Network process memory (MB) | unset | 256 | 512 | | 526 | + | | Network process memory (MB) | unset | 384 | unset | |
| 527 | - | | Conservative threshold | unset | 0.25 | 0.5 | | 527 | + | | Conservative threshold | unset | 0.25 | unset | |
| 528 | - | | Strict threshold | unset | 0.4 | 0.7 | | 528 | + | | Strict threshold | unset | 0.4 | unset | |
| 529 | - | | Kill threshold | unset | 0.8 | unset (never) | | 529 | + | | WebView pool prewarm | 4 | 2 | scales with RAM | |
| 530 | - | | WebView pool prewarm | 4 | 2 | 8 | | |||
| 531 | 530 | ||||
| 532 | **Example:** | 531 | **Example:** | ||
| 533 | ```toml | 532 | ```toml | ||
| @@ -557,12 +556,10 @@ When `profile = "custom"`, you can configure individual tuning options: | |||||
| 557 | | `performance.web_process_memory_poll_interval_sec` | float | `0` | Memory check interval (0=WebKit default: 30s) | | 556 | | `performance.web_process_memory_poll_interval_sec` | float | `0` | Memory check interval (0=WebKit default: 30s) | | ||
| 558 | | `performance.web_process_memory_conservative_threshold` | float | `0` | Conservative cleanup threshold (0=unset) | | 557 | | `performance.web_process_memory_conservative_threshold` | float | `0` | Conservative cleanup threshold (0=unset) | | ||
| 559 | | `performance.web_process_memory_strict_threshold` | float | `0` | Strict cleanup threshold (0=unset) | | 558 | | `performance.web_process_memory_strict_threshold` | float | `0` | Strict cleanup threshold (0=unset) | | ||
| 560 | - | | `performance.web_process_memory_kill_threshold` | float | `-1` | Process kill threshold (-1=unset, 0=never kill) | | |||
| 561 | | `performance.network_process_memory_limit_mb` | int | `0` | Network process memory limit in MB | | 559 | | `performance.network_process_memory_limit_mb` | int | `0` | Network process memory limit in MB | | ||
| 562 | | `performance.network_process_memory_poll_interval_sec` | float | `0` | Network memory check interval | | 560 | | `performance.network_process_memory_poll_interval_sec` | float | `0` | Network memory check interval | | ||
| 563 | | `performance.network_process_memory_conservative_threshold` | float | `0` | Network conservative threshold | | 561 | | `performance.network_process_memory_conservative_threshold` | float | `0` | Network conservative threshold | | ||
| 564 | | `performance.network_process_memory_strict_threshold` | float | `0` | Network strict threshold | | 562 | | `performance.network_process_memory_strict_threshold` | float | `0` | Network strict threshold | | ||
| 565 | - | | `performance.network_process_memory_kill_threshold` | float | `-1` | Network process kill threshold | | |||
| 566 | | `performance.webview_pool_prewarm_count` | int | `4` | WebViews to pre-create at startup | | 563 | | `performance.webview_pool_prewarm_count` | int | `4` | WebViews to pre-create at startup | | ||
| 567 | | `performance.zoom_cache_size` | int | `256` | Domain zoom levels to cache | | 564 | | `performance.zoom_cache_size` | int | `256` | Domain zoom levels to cache | | ||
| 568 | 565 | ||||
| @@ -579,7 +576,6 @@ skia_gpu_painting_threads = 2 | |||||
| 579 | web_process_memory_limit_mb = 1024 | 576 | web_process_memory_limit_mb = 1024 | ||
| 580 | web_process_memory_conservative_threshold = 0.4 | 577 | web_process_memory_conservative_threshold = 0.4 | ||
| 581 | web_process_memory_strict_threshold = 0.6 | 578 | web_process_memory_strict_threshold = 0.6 | ||
| 582 | - | web_process_memory_kill_threshold = -1 # Never kill | |||
| 583 | 579 | ||||
| 584 | # WebView pool | 580 | # WebView pool | ||
| 585 | webview_pool_prewarm_count = 6 | 581 | webview_pool_prewarm_count = 6 | ||
M internal/application/port/webkit_context.go +2 -7
| @@ -4,7 +4,7 @@ package port | |||
| 4 | 4 | import "context" | |
| 5 | 5 | ||
| 6 | 6 | // MemoryPressureConfig holds memory pressure settings for a WebKit process. | |
| 7 | - | // Zero values mean "use WebKit defaults" except for KillThreshold where -1 means unset. | |
| 7 | + | // Zero values mean "use WebKit defaults". | |
| 8 | 8 | type MemoryPressureConfig struct { | |
| 9 | 9 | // MemoryLimitMB sets the memory limit in megabytes. | |
| 10 | 10 | // 0 means unset (uses WebKit default: system RAM capped at 3GB). | |
| @@ -21,10 +21,6 @@ type MemoryPressureConfig struct { | |||
| 21 | 21 | // StrictThreshold sets threshold for strict memory release. | |
| 22 | 22 | // Must be in (0, 1). 0 means unset (uses WebKit default: 0.5). | |
| 23 | 23 | StrictThreshold float64 | |
| 24 | - | ||
| 25 | - | // KillThreshold sets threshold for killing the process. | |
| 26 | - | // -1 means unset; 0 means never kill; values > 1 are allowed by WebKit. | |
| 27 | - | KillThreshold float64 | |
| 28 | 24 | } | |
| 29 | 25 | ||
| 30 | 26 | // IsConfigured returns true if any memory pressure setting is configured. | |
| @@ -35,8 +31,7 @@ func (c *MemoryPressureConfig) IsConfigured() bool { | |||
| 35 | 31 | return c.MemoryLimitMB > 0 || | |
| 36 | 32 | c.PollIntervalSec > 0 || | |
| 37 | 33 | c.ConservativeThreshold > 0 || | |
| 38 | - | c.StrictThreshold > 0 || | |
| 39 | - | c.KillThreshold >= 0 | |
| 34 | + | c.StrictThreshold > 0 | |
| 40 | 35 | } | |
| 41 | 36 | ||
| 42 | 37 | // WebKitContextOptions configures WebKitContext creation. | |
| @@ -4,7 +4,7 @@ package port | |||||
| 4 | import "context" | 4 | import "context" | ||
| 5 | 5 | ||||
| 6 | // MemoryPressureConfig holds memory pressure settings for a WebKit process. | 6 | // MemoryPressureConfig holds memory pressure settings for a WebKit process. | ||
| 7 | - | // Zero values mean "use WebKit defaults" except for KillThreshold where -1 means unset. | 7 | + | // Zero values mean "use WebKit defaults". |
| 8 | type MemoryPressureConfig struct { | 8 | type MemoryPressureConfig struct { | ||
| 9 | // MemoryLimitMB sets the memory limit in megabytes. | 9 | // MemoryLimitMB sets the memory limit in megabytes. | ||
| 10 | // 0 means unset (uses WebKit default: system RAM capped at 3GB). | 10 | // 0 means unset (uses WebKit default: system RAM capped at 3GB). | ||
| @@ -21,10 +21,6 @@ type MemoryPressureConfig struct { | |||||
| 21 | // StrictThreshold sets threshold for strict memory release. | 21 | // StrictThreshold sets threshold for strict memory release. | ||
| 22 | // Must be in (0, 1). 0 means unset (uses WebKit default: 0.5). | 22 | // Must be in (0, 1). 0 means unset (uses WebKit default: 0.5). | ||
| 23 | StrictThreshold float64 | 23 | StrictThreshold float64 | ||
| 24 | - | ||||
| 25 | - | // KillThreshold sets threshold for killing the process. | |||
| 26 | - | // -1 means unset; 0 means never kill; values > 1 are allowed by WebKit. | |||
| 27 | - | KillThreshold float64 | |||
| 28 | } | 24 | } | ||
| 29 | 25 | ||||
| 30 | // IsConfigured returns true if any memory pressure setting is configured. | 26 | // IsConfigured returns true if any memory pressure setting is configured. | ||
| @@ -35,8 +31,7 @@ func (c *MemoryPressureConfig) IsConfigured() bool { | |||||
| 35 | return c.MemoryLimitMB > 0 || | 31 | return c.MemoryLimitMB > 0 || | ||
| 36 | c.PollIntervalSec > 0 || | 32 | c.PollIntervalSec > 0 || | ||
| 37 | c.ConservativeThreshold > 0 || | 33 | c.ConservativeThreshold > 0 || | ||
| 38 | - | c.StrictThreshold > 0 || | 34 | + | c.StrictThreshold > 0 |
| 39 | - | c.KillThreshold >= 0 | |||
| 40 | } | 35 | } | ||
| 41 | 36 | ||||
| 42 | // WebKitContextOptions configures WebKitContext creation. | 37 | // WebKitContextOptions configures WebKitContext creation. | ||
M internal/application/port/webkit_context_test.go +6 -35
| @@ -19,10 +19,8 @@ func TestMemoryPressureConfig_IsConfigured(t *testing.T) { | |||
| 19 | 19 | expected: false, | |
| 20 | 20 | }, | |
| 21 | 21 | { | |
| 22 | - | name: "empty config with default kill threshold", | |
| 23 | - | config: &port.MemoryPressureConfig{ | |
| 24 | - | KillThreshold: -1, // explicit unset | |
| 25 | - | }, | |
| 22 | + | name: "empty config", | |
| 23 | + | config: &port.MemoryPressureConfig{}, | |
| 26 | 24 | expected: false, | |
| 27 | 25 | }, | |
| 28 | 26 | { | |
| @@ -53,27 +51,6 @@ func TestMemoryPressureConfig_IsConfigured(t *testing.T) { | |||
| 53 | 51 | }, | |
| 54 | 52 | expected: true, | |
| 55 | 53 | }, | |
| 56 | - | { | |
| 57 | - | name: "KillThreshold set to 0 (never kill)", | |
| 58 | - | config: &port.MemoryPressureConfig{ | |
| 59 | - | KillThreshold: 0, | |
| 60 | - | }, | |
| 61 | - | expected: true, | |
| 62 | - | }, | |
| 63 | - | { | |
| 64 | - | name: "KillThreshold set to positive value", | |
| 65 | - | config: &port.MemoryPressureConfig{ | |
| 66 | - | KillThreshold: 1.5, | |
| 67 | - | }, | |
| 68 | - | expected: true, | |
| 69 | - | }, | |
| 70 | - | { | |
| 71 | - | name: "KillThreshold unset (-1)", | |
| 72 | - | config: &port.MemoryPressureConfig{ | |
| 73 | - | KillThreshold: -1, | |
| 74 | - | }, | |
| 75 | - | expected: false, | |
| 76 | - | }, | |
| 77 | 54 | { | |
| 78 | 55 | name: "all defaults (unset)", | |
| 79 | 56 | config: &port.MemoryPressureConfig{ | |
| @@ -81,7 +58,6 @@ func TestMemoryPressureConfig_IsConfigured(t *testing.T) { | |||
| 81 | 58 | PollIntervalSec: 0, | |
| 82 | 59 | ConservativeThreshold: 0, | |
| 83 | 60 | StrictThreshold: 0, | |
| 84 | - | KillThreshold: -1, | |
| 85 | 61 | }, | |
| 86 | 62 | expected: false, | |
| 87 | 63 | }, | |
| @@ -92,7 +68,6 @@ func TestMemoryPressureConfig_IsConfigured(t *testing.T) { | |||
| 92 | 68 | PollIntervalSec: 15.0, | |
| 93 | 69 | ConservativeThreshold: 0.25, | |
| 94 | 70 | StrictThreshold: 0.6, | |
| 95 | - | KillThreshold: 0.9, | |
| 96 | 71 | }, | |
| 97 | 72 | expected: true, | |
| 98 | 73 | }, | |
| @@ -118,11 +93,9 @@ func TestWebKitContextOptions_IsWebProcessMemoryConfigured(t *testing.T) { | |||
| 118 | 93 | expected: false, | |
| 119 | 94 | }, | |
| 120 | 95 | { | |
| 121 | - | name: "empty WebProcessMemory with default kill threshold", | |
| 96 | + | name: "empty WebProcessMemory", | |
| 122 | 97 | opts: port.WebKitContextOptions{ | |
| 123 | - | WebProcessMemory: &port.MemoryPressureConfig{ | |
| 124 | - | KillThreshold: -1, // explicit unset | |
| 125 | - | }, | |
| 98 | + | WebProcessMemory: &port.MemoryPressureConfig{}, | |
| 126 | 99 | }, | |
| 127 | 100 | expected: false, | |
| 128 | 101 | }, | |
| @@ -157,11 +130,9 @@ func TestWebKitContextOptions_IsNetworkProcessMemoryConfigured(t *testing.T) { | |||
| 157 | 130 | expected: false, | |
| 158 | 131 | }, | |
| 159 | 132 | { | |
| 160 | - | name: "empty NetworkProcessMemory with default kill threshold", | |
| 133 | + | name: "empty NetworkProcessMemory", | |
| 161 | 134 | opts: port.WebKitContextOptions{ | |
| 162 | - | NetworkProcessMemory: &port.MemoryPressureConfig{ | |
| 163 | - | KillThreshold: -1, // explicit unset | |
| 164 | - | }, | |
| 135 | + | NetworkProcessMemory: &port.MemoryPressureConfig{}, | |
| 165 | 136 | }, | |
| 166 | 137 | expected: false, | |
| 167 | 138 | }, | |
| @@ -19,10 +19,8 @@ func TestMemoryPressureConfig_IsConfigured(t *testing.T) { | |||||
| 19 | expected: false, | 19 | expected: false, | ||
| 20 | }, | 20 | }, | ||
| 21 | { | 21 | { | ||
| 22 | - | name: "empty config with default kill threshold", | 22 | + | name: "empty config", |
| 23 | - | config: &port.MemoryPressureConfig{ | 23 | + | config: &port.MemoryPressureConfig{}, |
| 24 | - | KillThreshold: -1, // explicit unset | |||
| 25 | - | }, | |||
| 26 | expected: false, | 24 | expected: false, | ||
| 27 | }, | 25 | }, | ||
| 28 | { | 26 | { | ||
| @@ -53,27 +51,6 @@ func TestMemoryPressureConfig_IsConfigured(t *testing.T) { | |||||
| 53 | }, | 51 | }, | ||
| 54 | expected: true, | 52 | expected: true, | ||
| 55 | }, | 53 | }, | ||
| 56 | - | { | |||
| 57 | - | name: "KillThreshold set to 0 (never kill)", | |||
| 58 | - | config: &port.MemoryPressureConfig{ | |||
| 59 | - | KillThreshold: 0, | |||
| 60 | - | }, | |||
| 61 | - | expected: true, | |||
| 62 | - | }, | |||
| 63 | - | { | |||
| 64 | - | name: "KillThreshold set to positive value", | |||
| 65 | - | config: &port.MemoryPressureConfig{ | |||
| 66 | - | KillThreshold: 1.5, | |||
| 67 | - | }, | |||
| 68 | - | expected: true, | |||
| 69 | - | }, | |||
| 70 | - | { | |||
| 71 | - | name: "KillThreshold unset (-1)", | |||
| 72 | - | config: &port.MemoryPressureConfig{ | |||
| 73 | - | KillThreshold: -1, | |||
| 74 | - | }, | |||
| 75 | - | expected: false, | |||
| 76 | - | }, | |||
| 77 | { | 54 | { | ||
| 78 | name: "all defaults (unset)", | 55 | name: "all defaults (unset)", | ||
| 79 | config: &port.MemoryPressureConfig{ | 56 | config: &port.MemoryPressureConfig{ | ||
| @@ -81,7 +58,6 @@ func TestMemoryPressureConfig_IsConfigured(t *testing.T) { | |||||
| 81 | PollIntervalSec: 0, | 58 | PollIntervalSec: 0, | ||
| 82 | ConservativeThreshold: 0, | 59 | ConservativeThreshold: 0, | ||
| 83 | StrictThreshold: 0, | 60 | StrictThreshold: 0, | ||
| 84 | - | KillThreshold: -1, | |||
| 85 | }, | 61 | }, | ||
| 86 | expected: false, | 62 | expected: false, | ||
| 87 | }, | 63 | }, | ||
| @@ -92,7 +68,6 @@ func TestMemoryPressureConfig_IsConfigured(t *testing.T) { | |||||
| 92 | PollIntervalSec: 15.0, | 68 | PollIntervalSec: 15.0, | ||
| 93 | ConservativeThreshold: 0.25, | 69 | ConservativeThreshold: 0.25, | ||
| 94 | StrictThreshold: 0.6, | 70 | StrictThreshold: 0.6, | ||
| 95 | - | KillThreshold: 0.9, | |||
| 96 | }, | 71 | }, | ||
| 97 | expected: true, | 72 | expected: true, | ||
| 98 | }, | 73 | }, | ||
| @@ -118,11 +93,9 @@ func TestWebKitContextOptions_IsWebProcessMemoryConfigured(t *testing.T) { | |||||
| 118 | expected: false, | 93 | expected: false, | ||
| 119 | }, | 94 | }, | ||
| 120 | { | 95 | { | ||
| 121 | - | name: "empty WebProcessMemory with default kill threshold", | 96 | + | name: "empty WebProcessMemory", |
| 122 | opts: port.WebKitContextOptions{ | 97 | opts: port.WebKitContextOptions{ | ||
| 123 | - | WebProcessMemory: &port.MemoryPressureConfig{ | 98 | + | WebProcessMemory: &port.MemoryPressureConfig{}, |
| 124 | - | KillThreshold: -1, // explicit unset | |||
| 125 | - | }, | |||
| 126 | }, | 99 | }, | ||
| 127 | expected: false, | 100 | expected: false, | ||
| 128 | }, | 101 | }, | ||
| @@ -157,11 +130,9 @@ func TestWebKitContextOptions_IsNetworkProcessMemoryConfigured(t *testing.T) { | |||||
| 157 | expected: false, | 130 | expected: false, | ||
| 158 | }, | 131 | }, | ||
| 159 | { | 132 | { | ||
| 160 | - | name: "empty NetworkProcessMemory with default kill threshold", | 133 | + | name: "empty NetworkProcessMemory", |
| 161 | opts: port.WebKitContextOptions{ | 134 | opts: port.WebKitContextOptions{ | ||
| 162 | - | NetworkProcessMemory: &port.MemoryPressureConfig{ | 135 | + | NetworkProcessMemory: &port.MemoryPressureConfig{}, |
| 163 | - | KillThreshold: -1, // explicit unset | |||
| 164 | - | }, | |||
| 165 | }, | 136 | }, | ||
| 166 | expected: false, | 137 | expected: false, | ||
| 167 | }, | 138 | }, | ||
M internal/bootstrap/webkit_stack.go +2 -6
| @@ -79,7 +79,6 @@ func BuildWebKitStack(input WebKitStackInput) WebKitStack { | |||
| 79 | 79 | PollIntervalSec: perfSettings.WebProcessMemoryPollIntervalSec, | |
| 80 | 80 | ConservativeThreshold: perfSettings.WebProcessMemoryConservativeThreshold, | |
| 81 | 81 | StrictThreshold: perfSettings.WebProcessMemoryStrictThreshold, | |
| 82 | - | KillThreshold: perfSettings.WebProcessMemoryKillThreshold, | |
| 83 | 82 | } | |
| 84 | 83 | } | |
| 85 | 84 | ||
| @@ -90,7 +89,6 @@ func BuildWebKitStack(input WebKitStackInput) WebKitStack { | |||
| 90 | 89 | PollIntervalSec: perfSettings.NetworkProcessMemoryPollIntervalSec, | |
| 91 | 90 | ConservativeThreshold: perfSettings.NetworkProcessMemoryConservativeThreshold, | |
| 92 | 91 | StrictThreshold: perfSettings.NetworkProcessMemoryStrictThreshold, | |
| 93 | - | KillThreshold: perfSettings.NetworkProcessMemoryKillThreshold, | |
| 94 | 92 | } | |
| 95 | 93 | } | |
| 96 | 94 | ||
| @@ -165,8 +163,7 @@ func hasWebProcessMemoryConfig(p *config.ResolvedPerformanceSettings) bool { | |||
| 165 | 163 | return p.WebProcessMemoryLimitMB > 0 || | |
| 166 | 164 | p.WebProcessMemoryPollIntervalSec > 0 || | |
| 167 | 165 | p.WebProcessMemoryConservativeThreshold > 0 || | |
| 168 | - | p.WebProcessMemoryStrictThreshold > 0 || | |
| 169 | - | p.WebProcessMemoryKillThreshold >= 0 | |
| 166 | + | p.WebProcessMemoryStrictThreshold > 0 | |
| 170 | 167 | } | |
| 171 | 168 | ||
| 172 | 169 | // hasNetworkProcessMemoryConfig returns true if any network process memory setting is configured. | |
| @@ -174,8 +171,7 @@ func hasNetworkProcessMemoryConfig(p *config.ResolvedPerformanceSettings) bool { | |||
| 174 | 171 | return p.NetworkProcessMemoryLimitMB > 0 || | |
| 175 | 172 | p.NetworkProcessMemoryPollIntervalSec > 0 || | |
| 176 | 173 | p.NetworkProcessMemoryConservativeThreshold > 0 || | |
| 177 | - | p.NetworkProcessMemoryStrictThreshold > 0 || | |
| 178 | - | p.NetworkProcessMemoryKillThreshold >= 0 | |
| 174 | + | p.NetworkProcessMemoryStrictThreshold > 0 | |
| 179 | 175 | } | |
| 180 | 176 | ||
| 181 | 177 | // configureRenderingEnvironment sets up the rendering environment before WebKit/GTK initialization. | |
| @@ -79,7 +79,6 @@ func BuildWebKitStack(input WebKitStackInput) WebKitStack { | |||||
| 79 | PollIntervalSec: perfSettings.WebProcessMemoryPollIntervalSec, | 79 | PollIntervalSec: perfSettings.WebProcessMemoryPollIntervalSec, | ||
| 80 | ConservativeThreshold: perfSettings.WebProcessMemoryConservativeThreshold, | 80 | ConservativeThreshold: perfSettings.WebProcessMemoryConservativeThreshold, | ||
| 81 | StrictThreshold: perfSettings.WebProcessMemoryStrictThreshold, | 81 | StrictThreshold: perfSettings.WebProcessMemoryStrictThreshold, | ||
| 82 | - | KillThreshold: perfSettings.WebProcessMemoryKillThreshold, | |||
| 83 | } | 82 | } | ||
| 84 | } | 83 | } | ||
| 85 | 84 | ||||
| @@ -90,7 +89,6 @@ func BuildWebKitStack(input WebKitStackInput) WebKitStack { | |||||
| 90 | PollIntervalSec: perfSettings.NetworkProcessMemoryPollIntervalSec, | 89 | PollIntervalSec: perfSettings.NetworkProcessMemoryPollIntervalSec, | ||
| 91 | ConservativeThreshold: perfSettings.NetworkProcessMemoryConservativeThreshold, | 90 | ConservativeThreshold: perfSettings.NetworkProcessMemoryConservativeThreshold, | ||
| 92 | StrictThreshold: perfSettings.NetworkProcessMemoryStrictThreshold, | 91 | StrictThreshold: perfSettings.NetworkProcessMemoryStrictThreshold, | ||
| 93 | - | KillThreshold: perfSettings.NetworkProcessMemoryKillThreshold, | |||
| 94 | } | 92 | } | ||
| 95 | } | 93 | } | ||
| 96 | 94 | ||||
| @@ -165,8 +163,7 @@ func hasWebProcessMemoryConfig(p *config.ResolvedPerformanceSettings) bool { | |||||
| 165 | return p.WebProcessMemoryLimitMB > 0 || | 163 | return p.WebProcessMemoryLimitMB > 0 || | ||
| 166 | p.WebProcessMemoryPollIntervalSec > 0 || | 164 | p.WebProcessMemoryPollIntervalSec > 0 || | ||
| 167 | p.WebProcessMemoryConservativeThreshold > 0 || | 165 | p.WebProcessMemoryConservativeThreshold > 0 || | ||
| 168 | - | p.WebProcessMemoryStrictThreshold > 0 || | 166 | + | p.WebProcessMemoryStrictThreshold > 0 |
| 169 | - | p.WebProcessMemoryKillThreshold >= 0 | |||
| 170 | } | 167 | } | ||
| 171 | 168 | ||||
| 172 | // hasNetworkProcessMemoryConfig returns true if any network process memory setting is configured. | 169 | // hasNetworkProcessMemoryConfig returns true if any network process memory setting is configured. | ||
| @@ -174,8 +171,7 @@ func hasNetworkProcessMemoryConfig(p *config.ResolvedPerformanceSettings) bool { | |||||
| 174 | return p.NetworkProcessMemoryLimitMB > 0 || | 171 | return p.NetworkProcessMemoryLimitMB > 0 || | ||
| 175 | p.NetworkProcessMemoryPollIntervalSec > 0 || | 172 | p.NetworkProcessMemoryPollIntervalSec > 0 || | ||
| 176 | p.NetworkProcessMemoryConservativeThreshold > 0 || | 173 | p.NetworkProcessMemoryConservativeThreshold > 0 || | ||
| 177 | - | p.NetworkProcessMemoryStrictThreshold > 0 || | 174 | + | p.NetworkProcessMemoryStrictThreshold > 0 |
| 178 | - | p.NetworkProcessMemoryKillThreshold >= 0 | |||
| 179 | } | 175 | } | ||
| 180 | 176 | ||||
| 181 | // configureRenderingEnvironment sets up the rendering environment before WebKit/GTK initialization. | 177 | // configureRenderingEnvironment sets up the rendering environment before WebKit/GTK initialization. | ||
M internal/infrastructure/config/defaults.go +0 -5
| @@ -69,9 +69,6 @@ const ( | |||
| 69 | 69 | // Skia threading defaults (0 = unset, -1 = unset for GPU threads) | |
| 70 | 70 | defaultSkiaCPUPaintingThreads = 0 | |
| 71 | 71 | defaultSkiaGPUPaintingThreads = -1 // -1 means unset; 0 would disable GPU tile painting | |
| 72 | - | ||
| 73 | - | // Memory pressure defaults (-1 = unset for kill threshold, 0 = unset for others) | |
| 74 | - | defaultMemoryPressureKillThreshold = -1.0 | |
| 75 | 72 | ) | |
| 76 | 73 | ||
| 77 | 74 | // getDefaultLogDir returns the default log directory, falls back to empty string on error | |
| @@ -302,13 +299,11 @@ func DefaultConfig() *Config { | |||
| 302 | 299 | WebProcessMemoryPollIntervalSec: 0, | |
| 303 | 300 | WebProcessMemoryConservativeThreshold: 0, | |
| 304 | 301 | WebProcessMemoryStrictThreshold: 0, | |
| 305 | - | WebProcessMemoryKillThreshold: defaultMemoryPressureKillThreshold, | |
| 306 | 302 | // Network process memory pressure - all unset by default | |
| 307 | 303 | NetworkProcessMemoryLimitMB: 0, | |
| 308 | 304 | NetworkProcessMemoryPollIntervalSec: 0, | |
| 309 | 305 | NetworkProcessMemoryConservativeThreshold: 0, | |
| 310 | 306 | NetworkProcessMemoryStrictThreshold: 0, | |
| 311 | - | NetworkProcessMemoryKillThreshold: defaultMemoryPressureKillThreshold, | |
| 312 | 307 | }, | |
| 313 | 308 | Update: UpdateConfig{ | |
| 314 | 309 | EnableOnStartup: true, // Check for updates on startup by default | |
| @@ -69,9 +69,6 @@ const ( | |||||
| 69 | // Skia threading defaults (0 = unset, -1 = unset for GPU threads) | 69 | // Skia threading defaults (0 = unset, -1 = unset for GPU threads) | ||
| 70 | defaultSkiaCPUPaintingThreads = 0 | 70 | defaultSkiaCPUPaintingThreads = 0 | ||
| 71 | defaultSkiaGPUPaintingThreads = -1 // -1 means unset; 0 would disable GPU tile painting | 71 | defaultSkiaGPUPaintingThreads = -1 // -1 means unset; 0 would disable GPU tile painting | ||
| 72 | - | ||||
| 73 | - | // Memory pressure defaults (-1 = unset for kill threshold, 0 = unset for others) | |||
| 74 | - | defaultMemoryPressureKillThreshold = -1.0 | |||
| 75 | ) | 72 | ) | ||
| 76 | 73 | ||||
| 77 | // getDefaultLogDir returns the default log directory, falls back to empty string on error | 74 | // getDefaultLogDir returns the default log directory, falls back to empty string on error | ||
| @@ -302,13 +299,11 @@ func DefaultConfig() *Config { | |||||
| 302 | WebProcessMemoryPollIntervalSec: 0, | 299 | WebProcessMemoryPollIntervalSec: 0, | ||
| 303 | WebProcessMemoryConservativeThreshold: 0, | 300 | WebProcessMemoryConservativeThreshold: 0, | ||
| 304 | WebProcessMemoryStrictThreshold: 0, | 301 | WebProcessMemoryStrictThreshold: 0, | ||
| 305 | - | WebProcessMemoryKillThreshold: defaultMemoryPressureKillThreshold, | |||
| 306 | // Network process memory pressure - all unset by default | 302 | // Network process memory pressure - all unset by default | ||
| 307 | NetworkProcessMemoryLimitMB: 0, | 303 | NetworkProcessMemoryLimitMB: 0, | ||
| 308 | NetworkProcessMemoryPollIntervalSec: 0, | 304 | NetworkProcessMemoryPollIntervalSec: 0, | ||
| 309 | NetworkProcessMemoryConservativeThreshold: 0, | 305 | NetworkProcessMemoryConservativeThreshold: 0, | ||
| 310 | NetworkProcessMemoryStrictThreshold: 0, | 306 | NetworkProcessMemoryStrictThreshold: 0, | ||
| 311 | - | NetworkProcessMemoryKillThreshold: defaultMemoryPressureKillThreshold, | |||
| 312 | }, | 307 | }, | ||
| 313 | Update: UpdateConfig{ | 308 | Update: UpdateConfig{ | ||
| 314 | EnableOnStartup: true, // Check for updates on startup by default | 309 | EnableOnStartup: true, // Check for updates on startup by default | ||
M internal/infrastructure/config/loader.go +0 -2
| @@ -492,14 +492,12 @@ func (m *Manager) setPerformanceDefaults(defaults *Config) { | |||
| 492 | 492 | m.viper.SetDefault("performance.web_process_memory_poll_interval_sec", defaults.Performance.WebProcessMemoryPollIntervalSec) | |
| 493 | 493 | m.viper.SetDefault("performance.web_process_memory_conservative_threshold", defaults.Performance.WebProcessMemoryConservativeThreshold) | |
| 494 | 494 | m.viper.SetDefault("performance.web_process_memory_strict_threshold", defaults.Performance.WebProcessMemoryStrictThreshold) | |
| 495 | - | m.viper.SetDefault("performance.web_process_memory_kill_threshold", defaults.Performance.WebProcessMemoryKillThreshold) | |
| 496 | 495 | // Network process memory pressure | |
| 497 | 496 | m.viper.SetDefault("performance.network_process_memory_limit_mb", defaults.Performance.NetworkProcessMemoryLimitMB) | |
| 498 | 497 | m.viper.SetDefault("performance.network_process_memory_poll_interval_sec", defaults.Performance.NetworkProcessMemoryPollIntervalSec) | |
| 499 | 498 | netConservativeThreshold := defaults.Performance.NetworkProcessMemoryConservativeThreshold | |
| 500 | 499 | m.viper.SetDefault("performance.network_process_memory_conservative_threshold", netConservativeThreshold) | |
| 501 | 500 | m.viper.SetDefault("performance.network_process_memory_strict_threshold", defaults.Performance.NetworkProcessMemoryStrictThreshold) | |
| 502 | - | m.viper.SetDefault("performance.network_process_memory_kill_threshold", defaults.Performance.NetworkProcessMemoryKillThreshold) | |
| 503 | 501 | } | |
| 504 | 502 | ||
| 505 | 503 | // New returns a new default configuration instance. | |
| @@ -492,14 +492,12 @@ func (m *Manager) setPerformanceDefaults(defaults *Config) { | |||||
| 492 | m.viper.SetDefault("performance.web_process_memory_poll_interval_sec", defaults.Performance.WebProcessMemoryPollIntervalSec) | 492 | m.viper.SetDefault("performance.web_process_memory_poll_interval_sec", defaults.Performance.WebProcessMemoryPollIntervalSec) | ||
| 493 | m.viper.SetDefault("performance.web_process_memory_conservative_threshold", defaults.Performance.WebProcessMemoryConservativeThreshold) | 493 | m.viper.SetDefault("performance.web_process_memory_conservative_threshold", defaults.Performance.WebProcessMemoryConservativeThreshold) | ||
| 494 | m.viper.SetDefault("performance.web_process_memory_strict_threshold", defaults.Performance.WebProcessMemoryStrictThreshold) | 494 | m.viper.SetDefault("performance.web_process_memory_strict_threshold", defaults.Performance.WebProcessMemoryStrictThreshold) | ||
| 495 | - | m.viper.SetDefault("performance.web_process_memory_kill_threshold", defaults.Performance.WebProcessMemoryKillThreshold) | |||
| 496 | // Network process memory pressure | 495 | // Network process memory pressure | ||
| 497 | m.viper.SetDefault("performance.network_process_memory_limit_mb", defaults.Performance.NetworkProcessMemoryLimitMB) | 496 | m.viper.SetDefault("performance.network_process_memory_limit_mb", defaults.Performance.NetworkProcessMemoryLimitMB) | ||
| 498 | m.viper.SetDefault("performance.network_process_memory_poll_interval_sec", defaults.Performance.NetworkProcessMemoryPollIntervalSec) | 497 | m.viper.SetDefault("performance.network_process_memory_poll_interval_sec", defaults.Performance.NetworkProcessMemoryPollIntervalSec) | ||
| 499 | netConservativeThreshold := defaults.Performance.NetworkProcessMemoryConservativeThreshold | 498 | netConservativeThreshold := defaults.Performance.NetworkProcessMemoryConservativeThreshold | ||
| 500 | m.viper.SetDefault("performance.network_process_memory_conservative_threshold", netConservativeThreshold) | 499 | m.viper.SetDefault("performance.network_process_memory_conservative_threshold", netConservativeThreshold) | ||
| 501 | m.viper.SetDefault("performance.network_process_memory_strict_threshold", defaults.Performance.NetworkProcessMemoryStrictThreshold) | 500 | m.viper.SetDefault("performance.network_process_memory_strict_threshold", defaults.Performance.NetworkProcessMemoryStrictThreshold) | ||
| 502 | - | m.viper.SetDefault("performance.network_process_memory_kill_threshold", defaults.Performance.NetworkProcessMemoryKillThreshold) | |||
| 503 | } | 501 | } | ||
| 504 | 502 | ||||
| 505 | // New returns a new default configuration instance. | 503 | // New returns a new default configuration instance. | ||
M internal/infrastructure/config/profile.go +11 -25
| @@ -65,14 +65,12 @@ type ResolvedPerformanceSettings struct { | |||
| 65 | 65 | WebProcessMemoryPollIntervalSec float64 | |
| 66 | 66 | WebProcessMemoryConservativeThreshold float64 | |
| 67 | 67 | WebProcessMemoryStrictThreshold float64 | |
| 68 | - | WebProcessMemoryKillThreshold float64 | |
| 69 | 68 | ||
| 70 | 69 | // Network process memory pressure | |
| 71 | 70 | NetworkProcessMemoryLimitMB int | |
| 72 | 71 | NetworkProcessMemoryPollIntervalSec float64 | |
| 73 | 72 | NetworkProcessMemoryConservativeThreshold float64 | |
| 74 | 73 | NetworkProcessMemoryStrictThreshold float64 | |
| 75 | - | NetworkProcessMemoryKillThreshold float64 | |
| 76 | 74 | ||
| 77 | 75 | // WebView pool | |
| 78 | 76 | WebViewPoolPrewarmCount int | |
| @@ -108,13 +106,11 @@ func resolveDefaultProfile() ResolvedPerformanceSettings { | |||
| 108 | 106 | WebProcessMemoryPollIntervalSec: 0, | |
| 109 | 107 | WebProcessMemoryConservativeThreshold: 0, | |
| 110 | 108 | WebProcessMemoryStrictThreshold: 0, | |
| 111 | - | WebProcessMemoryKillThreshold: -1, | |
| 112 | 109 | ||
| 113 | 110 | NetworkProcessMemoryLimitMB: 0, | |
| 114 | 111 | NetworkProcessMemoryPollIntervalSec: 0, | |
| 115 | 112 | NetworkProcessMemoryConservativeThreshold: 0, | |
| 116 | 113 | NetworkProcessMemoryStrictThreshold: 0, | |
| 117 | - | NetworkProcessMemoryKillThreshold: -1, | |
| 118 | 114 | ||
| 119 | 115 | WebViewPoolPrewarmCount: 4, | |
| 120 | 116 | } | |
| @@ -134,17 +130,15 @@ func resolveLiteProfile(hw *port.HardwareInfo) ResolvedPerformanceSettings { | |||
| 134 | 130 | SkiaGPUPaintingThreads: -1, // unset | |
| 135 | 131 | SkiaEnableCPURendering: false, | |
| 136 | 132 | ||
| 137 | - | WebProcessMemoryLimitMB: 512, | |
| 133 | + | WebProcessMemoryLimitMB: 768, | |
| 138 | 134 | WebProcessMemoryPollIntervalSec: 0, // use WebKit default (30s) | |
| 139 | 135 | WebProcessMemoryConservativeThreshold: 0.25, | |
| 140 | 136 | WebProcessMemoryStrictThreshold: 0.4, | |
| 141 | - | WebProcessMemoryKillThreshold: 0.8, | |
| 142 | 137 | ||
| 143 | - | NetworkProcessMemoryLimitMB: 256, | |
| 138 | + | NetworkProcessMemoryLimitMB: 384, | |
| 144 | 139 | NetworkProcessMemoryPollIntervalSec: 0, | |
| 145 | 140 | NetworkProcessMemoryConservativeThreshold: 0.25, | |
| 146 | 141 | NetworkProcessMemoryStrictThreshold: 0.4, | |
| 147 | - | NetworkProcessMemoryKillThreshold: 0.8, | |
| 148 | 142 | ||
| 149 | 143 | WebViewPoolPrewarmCount: 2, | |
| 150 | 144 | } | |
| @@ -159,9 +153,6 @@ func resolveMaxProfile(hw *port.HardwareInfo) ResolvedPerformanceSettings { | |||
| 159 | 153 | // GPU threads: scale based on VRAM | |
| 160 | 154 | gpuThreads := computeMaxGPUThreads(hw) | |
| 161 | 155 | ||
| 162 | - | // Memory limits: scale based on system RAM | |
| 163 | - | webMemMB, netMemMB := computeMaxMemoryLimits(hw) | |
| 164 | - | ||
| 165 | 156 | // WebView pool: scale based on RAM | |
| 166 | 157 | poolPrewarm := computeMaxPoolPrewarm(hw) | |
| 167 | 158 | ||
| @@ -170,17 +161,16 @@ func resolveMaxProfile(hw *port.HardwareInfo) ResolvedPerformanceSettings { | |||
| 170 | 161 | SkiaGPUPaintingThreads: gpuThreads, | |
| 171 | 162 | SkiaEnableCPURendering: false, | |
| 172 | 163 | ||
| 173 | - | WebProcessMemoryLimitMB: webMemMB, | |
| 174 | - | WebProcessMemoryPollIntervalSec: 0, // use WebKit default | |
| 175 | - | WebProcessMemoryConservativeThreshold: 0.5, | |
| 176 | - | WebProcessMemoryStrictThreshold: 0.7, | |
| 177 | - | WebProcessMemoryKillThreshold: -1, // never kill | |
| 164 | + | // Max profile: no memory limits, let WebKit use defaults | |
| 165 | + | WebProcessMemoryLimitMB: 0, | |
| 166 | + | WebProcessMemoryPollIntervalSec: 0, | |
| 167 | + | WebProcessMemoryConservativeThreshold: 0, | |
| 168 | + | WebProcessMemoryStrictThreshold: 0, | |
| 178 | 169 | ||
| 179 | - | NetworkProcessMemoryLimitMB: netMemMB, | |
| 170 | + | NetworkProcessMemoryLimitMB: 0, | |
| 180 | 171 | NetworkProcessMemoryPollIntervalSec: 0, | |
| 181 | - | NetworkProcessMemoryConservativeThreshold: 0.5, | |
| 182 | - | NetworkProcessMemoryStrictThreshold: 0.7, | |
| 183 | - | NetworkProcessMemoryKillThreshold: -1, | |
| 172 | + | NetworkProcessMemoryConservativeThreshold: 0, | |
| 173 | + | NetworkProcessMemoryStrictThreshold: 0, | |
| 184 | 174 | ||
| 185 | 175 | WebViewPoolPrewarmCount: poolPrewarm, | |
| 186 | 176 | } | |
| @@ -280,13 +270,11 @@ func resolveCustomProfile(cfg *PerformanceConfig) ResolvedPerformanceSettings { | |||
| 280 | 270 | WebProcessMemoryPollIntervalSec: cfg.WebProcessMemoryPollIntervalSec, | |
| 281 | 271 | WebProcessMemoryConservativeThreshold: cfg.WebProcessMemoryConservativeThreshold, | |
| 282 | 272 | WebProcessMemoryStrictThreshold: cfg.WebProcessMemoryStrictThreshold, | |
| 283 | - | WebProcessMemoryKillThreshold: cfg.WebProcessMemoryKillThreshold, | |
| 284 | 273 | ||
| 285 | 274 | NetworkProcessMemoryLimitMB: cfg.NetworkProcessMemoryLimitMB, | |
| 286 | 275 | NetworkProcessMemoryPollIntervalSec: cfg.NetworkProcessMemoryPollIntervalSec, | |
| 287 | 276 | NetworkProcessMemoryConservativeThreshold: cfg.NetworkProcessMemoryConservativeThreshold, | |
| 288 | 277 | NetworkProcessMemoryStrictThreshold: cfg.NetworkProcessMemoryStrictThreshold, | |
| 289 | - | NetworkProcessMemoryKillThreshold: cfg.NetworkProcessMemoryKillThreshold, | |
| 290 | 278 | ||
| 291 | 279 | WebViewPoolPrewarmCount: cfg.WebViewPoolPrewarmCount, | |
| 292 | 280 | } | |
| @@ -302,12 +290,10 @@ func HasCustomPerformanceFields(cfg *PerformanceConfig) bool { | |||
| 302 | 290 | cfg.WebProcessMemoryPollIntervalSec != 0 || | |
| 303 | 291 | cfg.WebProcessMemoryConservativeThreshold != 0 || | |
| 304 | 292 | cfg.WebProcessMemoryStrictThreshold != 0 || | |
| 305 | - | cfg.WebProcessMemoryKillThreshold != -1 || | |
| 306 | 293 | cfg.NetworkProcessMemoryLimitMB != 0 || | |
| 307 | 294 | cfg.NetworkProcessMemoryPollIntervalSec != 0 || | |
| 308 | 295 | cfg.NetworkProcessMemoryConservativeThreshold != 0 || | |
| 309 | - | cfg.NetworkProcessMemoryStrictThreshold != 0 || | |
| 310 | - | cfg.NetworkProcessMemoryKillThreshold != -1 | |
| 296 | + | cfg.NetworkProcessMemoryStrictThreshold != 0 | |
| 311 | 297 | } | |
| 312 | 298 | ||
| 313 | 299 | // IsValidPerformanceProfile returns true if the profile name is recognized. | |
| @@ -65,14 +65,12 @@ type ResolvedPerformanceSettings struct { | |||||
| 65 | WebProcessMemoryPollIntervalSec float64 | 65 | WebProcessMemoryPollIntervalSec float64 | ||
| 66 | WebProcessMemoryConservativeThreshold float64 | 66 | WebProcessMemoryConservativeThreshold float64 | ||
| 67 | WebProcessMemoryStrictThreshold float64 | 67 | WebProcessMemoryStrictThreshold float64 | ||
| 68 | - | WebProcessMemoryKillThreshold float64 | |||
| 69 | 68 | ||||
| 70 | // Network process memory pressure | 69 | // Network process memory pressure | ||
| 71 | NetworkProcessMemoryLimitMB int | 70 | NetworkProcessMemoryLimitMB int | ||
| 72 | NetworkProcessMemoryPollIntervalSec float64 | 71 | NetworkProcessMemoryPollIntervalSec float64 | ||
| 73 | NetworkProcessMemoryConservativeThreshold float64 | 72 | NetworkProcessMemoryConservativeThreshold float64 | ||
| 74 | NetworkProcessMemoryStrictThreshold float64 | 73 | NetworkProcessMemoryStrictThreshold float64 | ||
| 75 | - | NetworkProcessMemoryKillThreshold float64 | |||
| 76 | 74 | ||||
| 77 | // WebView pool | 75 | // WebView pool | ||
| 78 | WebViewPoolPrewarmCount int | 76 | WebViewPoolPrewarmCount int | ||
| @@ -108,13 +106,11 @@ func resolveDefaultProfile() ResolvedPerformanceSettings { | |||||
| 108 | WebProcessMemoryPollIntervalSec: 0, | 106 | WebProcessMemoryPollIntervalSec: 0, | ||
| 109 | WebProcessMemoryConservativeThreshold: 0, | 107 | WebProcessMemoryConservativeThreshold: 0, | ||
| 110 | WebProcessMemoryStrictThreshold: 0, | 108 | WebProcessMemoryStrictThreshold: 0, | ||
| 111 | - | WebProcessMemoryKillThreshold: -1, | |||
| 112 | 109 | ||||
| 113 | NetworkProcessMemoryLimitMB: 0, | 110 | NetworkProcessMemoryLimitMB: 0, | ||
| 114 | NetworkProcessMemoryPollIntervalSec: 0, | 111 | NetworkProcessMemoryPollIntervalSec: 0, | ||
| 115 | NetworkProcessMemoryConservativeThreshold: 0, | 112 | NetworkProcessMemoryConservativeThreshold: 0, | ||
| 116 | NetworkProcessMemoryStrictThreshold: 0, | 113 | NetworkProcessMemoryStrictThreshold: 0, | ||
| 117 | - | NetworkProcessMemoryKillThreshold: -1, | |||
| 118 | 114 | ||||
| 119 | WebViewPoolPrewarmCount: 4, | 115 | WebViewPoolPrewarmCount: 4, | ||
| 120 | } | 116 | } | ||
| @@ -134,17 +130,15 @@ func resolveLiteProfile(hw *port.HardwareInfo) ResolvedPerformanceSettings { | |||||
| 134 | SkiaGPUPaintingThreads: -1, // unset | 130 | SkiaGPUPaintingThreads: -1, // unset | ||
| 135 | SkiaEnableCPURendering: false, | 131 | SkiaEnableCPURendering: false, | ||
| 136 | 132 | ||||
| 137 | - | WebProcessMemoryLimitMB: 512, | 133 | + | WebProcessMemoryLimitMB: 768, |
| 138 | WebProcessMemoryPollIntervalSec: 0, // use WebKit default (30s) | 134 | WebProcessMemoryPollIntervalSec: 0, // use WebKit default (30s) | ||
| 139 | WebProcessMemoryConservativeThreshold: 0.25, | 135 | WebProcessMemoryConservativeThreshold: 0.25, | ||
| 140 | WebProcessMemoryStrictThreshold: 0.4, | 136 | WebProcessMemoryStrictThreshold: 0.4, | ||
| 141 | - | WebProcessMemoryKillThreshold: 0.8, | |||
| 142 | 137 | ||||
| 143 | - | NetworkProcessMemoryLimitMB: 256, | 138 | + | NetworkProcessMemoryLimitMB: 384, |
| 144 | NetworkProcessMemoryPollIntervalSec: 0, | 139 | NetworkProcessMemoryPollIntervalSec: 0, | ||
| 145 | NetworkProcessMemoryConservativeThreshold: 0.25, | 140 | NetworkProcessMemoryConservativeThreshold: 0.25, | ||
| 146 | NetworkProcessMemoryStrictThreshold: 0.4, | 141 | NetworkProcessMemoryStrictThreshold: 0.4, | ||
| 147 | - | NetworkProcessMemoryKillThreshold: 0.8, | |||
| 148 | 142 | ||||
| 149 | WebViewPoolPrewarmCount: 2, | 143 | WebViewPoolPrewarmCount: 2, | ||
| 150 | } | 144 | } | ||
| @@ -159,9 +153,6 @@ func resolveMaxProfile(hw *port.HardwareInfo) ResolvedPerformanceSettings { | |||||
| 159 | // GPU threads: scale based on VRAM | 153 | // GPU threads: scale based on VRAM | ||
| 160 | gpuThreads := computeMaxGPUThreads(hw) | 154 | gpuThreads := computeMaxGPUThreads(hw) | ||
| 161 | 155 | ||||
| 162 | - | // Memory limits: scale based on system RAM | |||
| 163 | - | webMemMB, netMemMB := computeMaxMemoryLimits(hw) | |||
| 164 | - | ||||
| 165 | // WebView pool: scale based on RAM | 156 | // WebView pool: scale based on RAM | ||
| 166 | poolPrewarm := computeMaxPoolPrewarm(hw) | 157 | poolPrewarm := computeMaxPoolPrewarm(hw) | ||
| 167 | 158 | ||||
| @@ -170,17 +161,16 @@ func resolveMaxProfile(hw *port.HardwareInfo) ResolvedPerformanceSettings { | |||||
| 170 | SkiaGPUPaintingThreads: gpuThreads, | 161 | SkiaGPUPaintingThreads: gpuThreads, | ||
| 171 | SkiaEnableCPURendering: false, | 162 | SkiaEnableCPURendering: false, | ||
| 172 | 163 | ||||
| 173 | - | WebProcessMemoryLimitMB: webMemMB, | 164 | + | // Max profile: no memory limits, let WebKit use defaults |
| 174 | - | WebProcessMemoryPollIntervalSec: 0, // use WebKit default | 165 | + | WebProcessMemoryLimitMB: 0, |
| 175 | - | WebProcessMemoryConservativeThreshold: 0.5, | 166 | + | WebProcessMemoryPollIntervalSec: 0, |
| 176 | - | WebProcessMemoryStrictThreshold: 0.7, | 167 | + | WebProcessMemoryConservativeThreshold: 0, |
| 177 | - | WebProcessMemoryKillThreshold: -1, // never kill | 168 | + | WebProcessMemoryStrictThreshold: 0, |
| 178 | 169 | ||||
| 179 | - | NetworkProcessMemoryLimitMB: netMemMB, | 170 | + | NetworkProcessMemoryLimitMB: 0, |
| 180 | NetworkProcessMemoryPollIntervalSec: 0, | 171 | NetworkProcessMemoryPollIntervalSec: 0, | ||
| 181 | - | NetworkProcessMemoryConservativeThreshold: 0.5, | 172 | + | NetworkProcessMemoryConservativeThreshold: 0, |
| 182 | - | NetworkProcessMemoryStrictThreshold: 0.7, | 173 | + | NetworkProcessMemoryStrictThreshold: 0, |
| 183 | - | NetworkProcessMemoryKillThreshold: -1, | |||
| 184 | 174 | ||||
| 185 | WebViewPoolPrewarmCount: poolPrewarm, | 175 | WebViewPoolPrewarmCount: poolPrewarm, | ||
| 186 | } | 176 | } | ||
| @@ -280,13 +270,11 @@ func resolveCustomProfile(cfg *PerformanceConfig) ResolvedPerformanceSettings { | |||||
| 280 | WebProcessMemoryPollIntervalSec: cfg.WebProcessMemoryPollIntervalSec, | 270 | WebProcessMemoryPollIntervalSec: cfg.WebProcessMemoryPollIntervalSec, | ||
| 281 | WebProcessMemoryConservativeThreshold: cfg.WebProcessMemoryConservativeThreshold, | 271 | WebProcessMemoryConservativeThreshold: cfg.WebProcessMemoryConservativeThreshold, | ||
| 282 | WebProcessMemoryStrictThreshold: cfg.WebProcessMemoryStrictThreshold, | 272 | WebProcessMemoryStrictThreshold: cfg.WebProcessMemoryStrictThreshold, | ||
| 283 | - | WebProcessMemoryKillThreshold: cfg.WebProcessMemoryKillThreshold, | |||
| 284 | 273 | ||||
| 285 | NetworkProcessMemoryLimitMB: cfg.NetworkProcessMemoryLimitMB, | 274 | NetworkProcessMemoryLimitMB: cfg.NetworkProcessMemoryLimitMB, | ||
| 286 | NetworkProcessMemoryPollIntervalSec: cfg.NetworkProcessMemoryPollIntervalSec, | 275 | NetworkProcessMemoryPollIntervalSec: cfg.NetworkProcessMemoryPollIntervalSec, | ||
| 287 | NetworkProcessMemoryConservativeThreshold: cfg.NetworkProcessMemoryConservativeThreshold, | 276 | NetworkProcessMemoryConservativeThreshold: cfg.NetworkProcessMemoryConservativeThreshold, | ||
| 288 | NetworkProcessMemoryStrictThreshold: cfg.NetworkProcessMemoryStrictThreshold, | 277 | NetworkProcessMemoryStrictThreshold: cfg.NetworkProcessMemoryStrictThreshold, | ||
| 289 | - | NetworkProcessMemoryKillThreshold: cfg.NetworkProcessMemoryKillThreshold, | |||
| 290 | 278 | ||||
| 291 | WebViewPoolPrewarmCount: cfg.WebViewPoolPrewarmCount, | 279 | WebViewPoolPrewarmCount: cfg.WebViewPoolPrewarmCount, | ||
| 292 | } | 280 | } | ||
| @@ -302,12 +290,10 @@ func HasCustomPerformanceFields(cfg *PerformanceConfig) bool { | |||||
| 302 | cfg.WebProcessMemoryPollIntervalSec != 0 || | 290 | cfg.WebProcessMemoryPollIntervalSec != 0 || | ||
| 303 | cfg.WebProcessMemoryConservativeThreshold != 0 || | 291 | cfg.WebProcessMemoryConservativeThreshold != 0 || | ||
| 304 | cfg.WebProcessMemoryStrictThreshold != 0 || | 292 | cfg.WebProcessMemoryStrictThreshold != 0 || | ||
| 305 | - | cfg.WebProcessMemoryKillThreshold != -1 || | |||
| 306 | cfg.NetworkProcessMemoryLimitMB != 0 || | 293 | cfg.NetworkProcessMemoryLimitMB != 0 || | ||
| 307 | cfg.NetworkProcessMemoryPollIntervalSec != 0 || | 294 | cfg.NetworkProcessMemoryPollIntervalSec != 0 || | ||
| 308 | cfg.NetworkProcessMemoryConservativeThreshold != 0 || | 295 | cfg.NetworkProcessMemoryConservativeThreshold != 0 || | ||
| 309 | - | cfg.NetworkProcessMemoryStrictThreshold != 0 || | 296 | + | cfg.NetworkProcessMemoryStrictThreshold != 0 |
| 310 | - | cfg.NetworkProcessMemoryKillThreshold != -1 | |||
| 311 | } | 297 | } | ||
| 312 | 298 | ||||
| 313 | // IsValidPerformanceProfile returns true if the profile name is recognized. | 299 | // IsValidPerformanceProfile returns true if the profile name is recognized. | ||
M internal/infrastructure/config/profile_test.go +28 -41
| @@ -55,18 +55,15 @@ func TestResolvePerformanceProfile_Lite_NoHardware(t *testing.T) { | |||
| 55 | 55 | if result.SkiaCPUPaintingThreads != 2 { | |
| 56 | 56 | t.Errorf("expected SkiaCPUPaintingThreads=2, got %d", result.SkiaCPUPaintingThreads) | |
| 57 | 57 | } | |
| 58 | - | if result.WebProcessMemoryLimitMB != 512 { | |
| 59 | - | t.Errorf("expected WebProcessMemoryLimitMB=512, got %d", result.WebProcessMemoryLimitMB) | |
| 58 | + | if result.WebProcessMemoryLimitMB != 768 { | |
| 59 | + | t.Errorf("expected WebProcessMemoryLimitMB=768, got %d", result.WebProcessMemoryLimitMB) | |
| 60 | 60 | } | |
| 61 | - | if result.NetworkProcessMemoryLimitMB != 256 { | |
| 62 | - | t.Errorf("expected NetworkProcessMemoryLimitMB=256, got %d", result.NetworkProcessMemoryLimitMB) | |
| 61 | + | if result.NetworkProcessMemoryLimitMB != 384 { | |
| 62 | + | t.Errorf("expected NetworkProcessMemoryLimitMB=384, got %d", result.NetworkProcessMemoryLimitMB) | |
| 63 | 63 | } | |
| 64 | 64 | if result.WebViewPoolPrewarmCount != 2 { | |
| 65 | 65 | t.Errorf("expected WebViewPoolPrewarmCount=2, got %d", result.WebViewPoolPrewarmCount) | |
| 66 | 66 | } | |
| 67 | - | if result.WebProcessMemoryKillThreshold != 0.8 { | |
| 68 | - | t.Errorf("expected WebProcessMemoryKillThreshold=0.8, got %f", result.WebProcessMemoryKillThreshold) | |
| 69 | - | } | |
| 70 | 67 | } | |
| 71 | 68 | ||
| 72 | 69 | func TestResolvePerformanceProfile_Lite_LowCoreSystem(t *testing.T) { | |
| @@ -109,16 +106,13 @@ func TestResolvePerformanceProfile_Max_NoHardware(t *testing.T) { | |||
| 109 | 106 | if result.SkiaGPUPaintingThreads != 2 { | |
| 110 | 107 | t.Errorf("expected SkiaGPUPaintingThreads=2 (fallback), got %d", result.SkiaGPUPaintingThreads) | |
| 111 | 108 | } | |
| 112 | - | // Memory: fallback assumes 16GB system | |
| 113 | - | if result.WebProcessMemoryLimitMB != 2048 { | |
| 114 | - | t.Errorf("expected WebProcessMemoryLimitMB=2048, got %d", result.WebProcessMemoryLimitMB) | |
| 109 | + | // Max profile: no memory limits (unset) | |
| 110 | + | if result.WebProcessMemoryLimitMB != 0 { | |
| 111 | + | t.Errorf("expected WebProcessMemoryLimitMB=0 (unset), got %d", result.WebProcessMemoryLimitMB) | |
| 115 | 112 | } | |
| 116 | 113 | if result.WebViewPoolPrewarmCount != 8 { | |
| 117 | 114 | t.Errorf("expected WebViewPoolPrewarmCount=8, got %d", result.WebViewPoolPrewarmCount) | |
| 118 | 115 | } | |
| 119 | - | if result.WebProcessMemoryKillThreshold != -1 { | |
| 120 | - | t.Errorf("expected WebProcessMemoryKillThreshold=-1 (never kill), got %f", result.WebProcessMemoryKillThreshold) | |
| 121 | - | } | |
| 122 | 116 | } | |
| 123 | 117 | ||
| 124 | 118 | func TestResolvePerformanceProfile_Max_HighEndSystem(t *testing.T) { | |
| @@ -143,12 +137,12 @@ func TestResolvePerformanceProfile_Max_HighEndSystem(t *testing.T) { | |||
| 143 | 137 | if result.SkiaGPUPaintingThreads != 8 { | |
| 144 | 138 | t.Errorf("expected SkiaGPUPaintingThreads=8 for 16GB VRAM, got %d", result.SkiaGPUPaintingThreads) | |
| 145 | 139 | } | |
| 146 | - | // Memory: high-end tier (32GB+ RAM) | |
| 147 | - | if result.WebProcessMemoryLimitMB != 4096 { | |
| 148 | - | t.Errorf("expected WebProcessMemoryLimitMB=4096 for 64GB RAM, got %d", result.WebProcessMemoryLimitMB) | |
| 140 | + | // Max profile: no memory limits (unset) | |
| 141 | + | if result.WebProcessMemoryLimitMB != 0 { | |
| 142 | + | t.Errorf("expected WebProcessMemoryLimitMB=0 (unset) for max profile, got %d", result.WebProcessMemoryLimitMB) | |
| 149 | 143 | } | |
| 150 | - | if result.NetworkProcessMemoryLimitMB != 1024 { | |
| 151 | - | t.Errorf("expected NetworkProcessMemoryLimitMB=1024 for 64GB RAM, got %d", result.NetworkProcessMemoryLimitMB) | |
| 144 | + | if result.NetworkProcessMemoryLimitMB != 0 { | |
| 145 | + | t.Errorf("expected NetworkProcessMemoryLimitMB=0 (unset) for max profile, got %d", result.NetworkProcessMemoryLimitMB) | |
| 152 | 146 | } | |
| 153 | 147 | // Pool prewarm: high-end tier | |
| 154 | 148 | if result.WebViewPoolPrewarmCount != 12 { | |
| @@ -178,9 +172,9 @@ func TestResolvePerformanceProfile_Max_MidRangeSystem(t *testing.T) { | |||
| 178 | 172 | if result.SkiaGPUPaintingThreads != 6 { | |
| 179 | 173 | t.Errorf("expected SkiaGPUPaintingThreads=6 for 8GB VRAM, got %d", result.SkiaGPUPaintingThreads) | |
| 180 | 174 | } | |
| 181 | - | // Memory: mid-range tier (16-32GB RAM) | |
| 182 | - | if result.WebProcessMemoryLimitMB != 3072 { | |
| 183 | - | t.Errorf("expected WebProcessMemoryLimitMB=3072 for 16GB RAM, got %d", result.WebProcessMemoryLimitMB) | |
| 175 | + | // Max profile: no memory limits (unset) | |
| 176 | + | if result.WebProcessMemoryLimitMB != 0 { | |
| 177 | + | t.Errorf("expected WebProcessMemoryLimitMB=0 (unset) for max profile, got %d", result.WebProcessMemoryLimitMB) | |
| 184 | 178 | } | |
| 185 | 179 | // Pool prewarm: mid-range tier | |
| 186 | 180 | if result.WebViewPoolPrewarmCount != 8 { | |
| @@ -210,9 +204,9 @@ func TestResolvePerformanceProfile_Max_LowEndSystem(t *testing.T) { | |||
| 210 | 204 | if result.SkiaGPUPaintingThreads != 2 { | |
| 211 | 205 | t.Errorf("expected SkiaGPUPaintingThreads=2 for 2GB VRAM, got %d", result.SkiaGPUPaintingThreads) | |
| 212 | 206 | } | |
| 213 | - | // Memory: low tier (<8GB RAM) | |
| 214 | - | if result.WebProcessMemoryLimitMB != 1024 { | |
| 215 | - | t.Errorf("expected WebProcessMemoryLimitMB=1024 for 4GB RAM, got %d", result.WebProcessMemoryLimitMB) | |
| 207 | + | // Max profile: no memory limits (unset) | |
| 208 | + | if result.WebProcessMemoryLimitMB != 0 { | |
| 209 | + | t.Errorf("expected WebProcessMemoryLimitMB=0 (unset) for max profile, got %d", result.WebProcessMemoryLimitMB) | |
| 216 | 210 | } | |
| 217 | 211 | // Pool prewarm: low tier | |
| 218 | 212 | if result.WebViewPoolPrewarmCount != 4 { | |
| @@ -267,40 +261,33 @@ func TestHasCustomPerformanceFields(t *testing.T) { | |||
| 267 | 261 | { | |
| 268 | 262 | name: "all defaults - no custom fields", | |
| 269 | 263 | cfg: PerformanceConfig{ | |
| 270 | - | SkiaCPUPaintingThreads: 0, | |
| 271 | - | SkiaGPUPaintingThreads: -1, | |
| 272 | - | SkiaEnableCPURendering: false, | |
| 273 | - | WebProcessMemoryKillThreshold: -1, | |
| 274 | - | NetworkProcessMemoryKillThreshold: -1, | |
| 264 | + | SkiaCPUPaintingThreads: 0, | |
| 265 | + | SkiaGPUPaintingThreads: -1, | |
| 266 | + | SkiaEnableCPURendering: false, | |
| 275 | 267 | }, | |
| 276 | 268 | expected: false, | |
| 277 | 269 | }, | |
| 278 | 270 | { | |
| 279 | 271 | name: "skia cpu threads set", | |
| 280 | 272 | cfg: PerformanceConfig{ | |
| 281 | - | SkiaCPUPaintingThreads: 4, | |
| 282 | - | SkiaGPUPaintingThreads: -1, | |
| 283 | - | WebProcessMemoryKillThreshold: -1, | |
| 284 | - | NetworkProcessMemoryKillThreshold: -1, | |
| 273 | + | SkiaCPUPaintingThreads: 4, | |
| 274 | + | SkiaGPUPaintingThreads: -1, | |
| 285 | 275 | }, | |
| 286 | 276 | expected: true, | |
| 287 | 277 | }, | |
| 288 | 278 | { | |
| 289 | 279 | name: "memory limit set", | |
| 290 | 280 | cfg: PerformanceConfig{ | |
| 291 | - | SkiaGPUPaintingThreads: -1, | |
| 292 | - | WebProcessMemoryLimitMB: 1024, | |
| 293 | - | WebProcessMemoryKillThreshold: -1, | |
| 294 | - | NetworkProcessMemoryKillThreshold: -1, | |
| 281 | + | SkiaGPUPaintingThreads: -1, | |
| 282 | + | WebProcessMemoryLimitMB: 1024, | |
| 295 | 283 | }, | |
| 296 | 284 | expected: true, | |
| 297 | 285 | }, | |
| 298 | 286 | { | |
| 299 | - | name: "kill threshold changed from -1", | |
| 287 | + | name: "conservative threshold set", | |
| 300 | 288 | cfg: PerformanceConfig{ | |
| 301 | - | SkiaGPUPaintingThreads: -1, | |
| 302 | - | WebProcessMemoryKillThreshold: 0.9, | |
| 303 | - | NetworkProcessMemoryKillThreshold: -1, | |
| 289 | + | SkiaGPUPaintingThreads: -1, | |
| 290 | + | WebProcessMemoryConservativeThreshold: 0.4, | |
| 304 | 291 | }, | |
| 305 | 292 | expected: true, | |
| 306 | 293 | }, | |
| @@ -55,18 +55,15 @@ func TestResolvePerformanceProfile_Lite_NoHardware(t *testing.T) { | |||||
| 55 | if result.SkiaCPUPaintingThreads != 2 { | 55 | if result.SkiaCPUPaintingThreads != 2 { | ||
| 56 | t.Errorf("expected SkiaCPUPaintingThreads=2, got %d", result.SkiaCPUPaintingThreads) | 56 | t.Errorf("expected SkiaCPUPaintingThreads=2, got %d", result.SkiaCPUPaintingThreads) | ||
| 57 | } | 57 | } | ||
| 58 | - | if result.WebProcessMemoryLimitMB != 512 { | 58 | + | if result.WebProcessMemoryLimitMB != 768 { |
| 59 | - | t.Errorf("expected WebProcessMemoryLimitMB=512, got %d", result.WebProcessMemoryLimitMB) | 59 | + | t.Errorf("expected WebProcessMemoryLimitMB=768, got %d", result.WebProcessMemoryLimitMB) |
| 60 | } | 60 | } | ||
| 61 | - | if result.NetworkProcessMemoryLimitMB != 256 { | 61 | + | if result.NetworkProcessMemoryLimitMB != 384 { |
| 62 | - | t.Errorf("expected NetworkProcessMemoryLimitMB=256, got %d", result.NetworkProcessMemoryLimitMB) | 62 | + | t.Errorf("expected NetworkProcessMemoryLimitMB=384, got %d", result.NetworkProcessMemoryLimitMB) |
| 63 | } | 63 | } | ||
| 64 | if result.WebViewPoolPrewarmCount != 2 { | 64 | if result.WebViewPoolPrewarmCount != 2 { | ||
| 65 | t.Errorf("expected WebViewPoolPrewarmCount=2, got %d", result.WebViewPoolPrewarmCount) | 65 | t.Errorf("expected WebViewPoolPrewarmCount=2, got %d", result.WebViewPoolPrewarmCount) | ||
| 66 | } | 66 | } | ||
| 67 | - | if result.WebProcessMemoryKillThreshold != 0.8 { | |||
| 68 | - | t.Errorf("expected WebProcessMemoryKillThreshold=0.8, got %f", result.WebProcessMemoryKillThreshold) | |||
| 69 | - | } | |||
| 70 | } | 67 | } | ||
| 71 | 68 | ||||
| 72 | func TestResolvePerformanceProfile_Lite_LowCoreSystem(t *testing.T) { | 69 | func TestResolvePerformanceProfile_Lite_LowCoreSystem(t *testing.T) { | ||
| @@ -109,16 +106,13 @@ func TestResolvePerformanceProfile_Max_NoHardware(t *testing.T) { | |||||
| 109 | if result.SkiaGPUPaintingThreads != 2 { | 106 | if result.SkiaGPUPaintingThreads != 2 { | ||
| 110 | t.Errorf("expected SkiaGPUPaintingThreads=2 (fallback), got %d", result.SkiaGPUPaintingThreads) | 107 | t.Errorf("expected SkiaGPUPaintingThreads=2 (fallback), got %d", result.SkiaGPUPaintingThreads) | ||
| 111 | } | 108 | } | ||
| 112 | - | // Memory: fallback assumes 16GB system | 109 | + | // Max profile: no memory limits (unset) |
| 113 | - | if result.WebProcessMemoryLimitMB != 2048 { | 110 | + | if result.WebProcessMemoryLimitMB != 0 { |
| 114 | - | t.Errorf("expected WebProcessMemoryLimitMB=2048, got %d", result.WebProcessMemoryLimitMB) | 111 | + | t.Errorf("expected WebProcessMemoryLimitMB=0 (unset), got %d", result.WebProcessMemoryLimitMB) |
| 115 | } | 112 | } | ||
| 116 | if result.WebViewPoolPrewarmCount != 8 { | 113 | if result.WebViewPoolPrewarmCount != 8 { | ||
| 117 | t.Errorf("expected WebViewPoolPrewarmCount=8, got %d", result.WebViewPoolPrewarmCount) | 114 | t.Errorf("expected WebViewPoolPrewarmCount=8, got %d", result.WebViewPoolPrewarmCount) | ||
| 118 | } | 115 | } | ||
| 119 | - | if result.WebProcessMemoryKillThreshold != -1 { | |||
| 120 | - | t.Errorf("expected WebProcessMemoryKillThreshold=-1 (never kill), got %f", result.WebProcessMemoryKillThreshold) | |||
| 121 | - | } | |||
| 122 | } | 116 | } | ||
| 123 | 117 | ||||
| 124 | func TestResolvePerformanceProfile_Max_HighEndSystem(t *testing.T) { | 118 | func TestResolvePerformanceProfile_Max_HighEndSystem(t *testing.T) { | ||
| @@ -143,12 +137,12 @@ func TestResolvePerformanceProfile_Max_HighEndSystem(t *testing.T) { | |||||
| 143 | if result.SkiaGPUPaintingThreads != 8 { | 137 | if result.SkiaGPUPaintingThreads != 8 { | ||
| 144 | t.Errorf("expected SkiaGPUPaintingThreads=8 for 16GB VRAM, got %d", result.SkiaGPUPaintingThreads) | 138 | t.Errorf("expected SkiaGPUPaintingThreads=8 for 16GB VRAM, got %d", result.SkiaGPUPaintingThreads) | ||
| 145 | } | 139 | } | ||
| 146 | - | // Memory: high-end tier (32GB+ RAM) | 140 | + | // Max profile: no memory limits (unset) |
| 147 | - | if result.WebProcessMemoryLimitMB != 4096 { | 141 | + | if result.WebProcessMemoryLimitMB != 0 { |
| 148 | - | t.Errorf("expected WebProcessMemoryLimitMB=4096 for 64GB RAM, got %d", result.WebProcessMemoryLimitMB) | 142 | + | t.Errorf("expected WebProcessMemoryLimitMB=0 (unset) for max profile, got %d", result.WebProcessMemoryLimitMB) |
| 149 | } | 143 | } | ||
| 150 | - | if result.NetworkProcessMemoryLimitMB != 1024 { | 144 | + | if result.NetworkProcessMemoryLimitMB != 0 { |
| 151 | - | t.Errorf("expected NetworkProcessMemoryLimitMB=1024 for 64GB RAM, got %d", result.NetworkProcessMemoryLimitMB) | 145 | + | t.Errorf("expected NetworkProcessMemoryLimitMB=0 (unset) for max profile, got %d", result.NetworkProcessMemoryLimitMB) |
| 152 | } | 146 | } | ||
| 153 | // Pool prewarm: high-end tier | 147 | // Pool prewarm: high-end tier | ||
| 154 | if result.WebViewPoolPrewarmCount != 12 { | 148 | if result.WebViewPoolPrewarmCount != 12 { | ||
| @@ -178,9 +172,9 @@ func TestResolvePerformanceProfile_Max_MidRangeSystem(t *testing.T) { | |||||
| 178 | if result.SkiaGPUPaintingThreads != 6 { | 172 | if result.SkiaGPUPaintingThreads != 6 { | ||
| 179 | t.Errorf("expected SkiaGPUPaintingThreads=6 for 8GB VRAM, got %d", result.SkiaGPUPaintingThreads) | 173 | t.Errorf("expected SkiaGPUPaintingThreads=6 for 8GB VRAM, got %d", result.SkiaGPUPaintingThreads) | ||
| 180 | } | 174 | } | ||
| 181 | - | // Memory: mid-range tier (16-32GB RAM) | 175 | + | // Max profile: no memory limits (unset) |
| 182 | - | if result.WebProcessMemoryLimitMB != 3072 { | 176 | + | if result.WebProcessMemoryLimitMB != 0 { |
| 183 | - | t.Errorf("expected WebProcessMemoryLimitMB=3072 for 16GB RAM, got %d", result.WebProcessMemoryLimitMB) | 177 | + | t.Errorf("expected WebProcessMemoryLimitMB=0 (unset) for max profile, got %d", result.WebProcessMemoryLimitMB) |
| 184 | } | 178 | } | ||
| 185 | // Pool prewarm: mid-range tier | 179 | // Pool prewarm: mid-range tier | ||
| 186 | if result.WebViewPoolPrewarmCount != 8 { | 180 | if result.WebViewPoolPrewarmCount != 8 { | ||
| @@ -210,9 +204,9 @@ func TestResolvePerformanceProfile_Max_LowEndSystem(t *testing.T) { | |||||
| 210 | if result.SkiaGPUPaintingThreads != 2 { | 204 | if result.SkiaGPUPaintingThreads != 2 { | ||
| 211 | t.Errorf("expected SkiaGPUPaintingThreads=2 for 2GB VRAM, got %d", result.SkiaGPUPaintingThreads) | 205 | t.Errorf("expected SkiaGPUPaintingThreads=2 for 2GB VRAM, got %d", result.SkiaGPUPaintingThreads) | ||
| 212 | } | 206 | } | ||
| 213 | - | // Memory: low tier (<8GB RAM) | 207 | + | // Max profile: no memory limits (unset) |
| 214 | - | if result.WebProcessMemoryLimitMB != 1024 { | 208 | + | if result.WebProcessMemoryLimitMB != 0 { |
| 215 | - | t.Errorf("expected WebProcessMemoryLimitMB=1024 for 4GB RAM, got %d", result.WebProcessMemoryLimitMB) | 209 | + | t.Errorf("expected WebProcessMemoryLimitMB=0 (unset) for max profile, got %d", result.WebProcessMemoryLimitMB) |
| 216 | } | 210 | } | ||
| 217 | // Pool prewarm: low tier | 211 | // Pool prewarm: low tier | ||
| 218 | if result.WebViewPoolPrewarmCount != 4 { | 212 | if result.WebViewPoolPrewarmCount != 4 { | ||
| @@ -267,40 +261,33 @@ func TestHasCustomPerformanceFields(t *testing.T) { | |||||
| 267 | { | 261 | { | ||
| 268 | name: "all defaults - no custom fields", | 262 | name: "all defaults - no custom fields", | ||
| 269 | cfg: PerformanceConfig{ | 263 | cfg: PerformanceConfig{ | ||
| 270 | - | SkiaCPUPaintingThreads: 0, | 264 | + | SkiaCPUPaintingThreads: 0, |
| 271 | - | SkiaGPUPaintingThreads: -1, | 265 | + | SkiaGPUPaintingThreads: -1, |
| 272 | - | SkiaEnableCPURendering: false, | 266 | + | SkiaEnableCPURendering: false, |
| 273 | - | WebProcessMemoryKillThreshold: -1, | |||
| 274 | - | NetworkProcessMemoryKillThreshold: -1, | |||
| 275 | }, | 267 | }, | ||
| 276 | expected: false, | 268 | expected: false, | ||
| 277 | }, | 269 | }, | ||
| 278 | { | 270 | { | ||
| 279 | name: "skia cpu threads set", | 271 | name: "skia cpu threads set", | ||
| 280 | cfg: PerformanceConfig{ | 272 | cfg: PerformanceConfig{ | ||
| 281 | - | SkiaCPUPaintingThreads: 4, | 273 | + | SkiaCPUPaintingThreads: 4, |
| 282 | - | SkiaGPUPaintingThreads: -1, | 274 | + | SkiaGPUPaintingThreads: -1, |
| 283 | - | WebProcessMemoryKillThreshold: -1, | |||
| 284 | - | NetworkProcessMemoryKillThreshold: -1, | |||
| 285 | }, | 275 | }, | ||
| 286 | expected: true, | 276 | expected: true, | ||
| 287 | }, | 277 | }, | ||
| 288 | { | 278 | { | ||
| 289 | name: "memory limit set", | 279 | name: "memory limit set", | ||
| 290 | cfg: PerformanceConfig{ | 280 | cfg: PerformanceConfig{ | ||
| 291 | - | SkiaGPUPaintingThreads: -1, | 281 | + | SkiaGPUPaintingThreads: -1, |
| 292 | - | WebProcessMemoryLimitMB: 1024, | 282 | + | WebProcessMemoryLimitMB: 1024, |
| 293 | - | WebProcessMemoryKillThreshold: -1, | |||
| 294 | - | NetworkProcessMemoryKillThreshold: -1, | |||
| 295 | }, | 283 | }, | ||
| 296 | expected: true, | 284 | expected: true, | ||
| 297 | }, | 285 | }, | ||
| 298 | { | 286 | { | ||
| 299 | - | name: "kill threshold changed from -1", | 287 | + | name: "conservative threshold set", |
| 300 | cfg: PerformanceConfig{ | 288 | cfg: PerformanceConfig{ | ||
| 301 | - | SkiaGPUPaintingThreads: -1, | 289 | + | SkiaGPUPaintingThreads: -1, |
| 302 | - | WebProcessMemoryKillThreshold: 0.9, | 290 | + | WebProcessMemoryConservativeThreshold: 0.4, |
| 303 | - | NetworkProcessMemoryKillThreshold: -1, | |||
| 304 | }, | 291 | }, | ||
| 305 | expected: true, | 292 | expected: true, | ||
| 306 | }, | 293 | }, | ||
M internal/infrastructure/config/schema.go +0 -8
| @@ -242,10 +242,6 @@ type PerformanceConfig struct { | |||
| 242 | 242 | // Valid: (0, 1). Default: 0 (unset, uses WebKit default: 0.5) | |
| 243 | 243 | WebProcessMemoryStrictThreshold float64 `mapstructure:"web_process_memory_strict_threshold" yaml:"web_process_memory_strict_threshold" toml:"web_process_memory_strict_threshold"` //nolint:lll // struct tags must stay on one line | |
| 244 | 244 | ||
| 245 | - | // WebProcessMemoryKillThreshold sets threshold for killing processes. | |
| 246 | - | // Default: -1 (unset). Value 0 means never kill. | |
| 247 | - | WebProcessMemoryKillThreshold float64 `mapstructure:"web_process_memory_kill_threshold" yaml:"web_process_memory_kill_threshold" toml:"web_process_memory_kill_threshold"` //nolint:lll // struct tags must stay on one line | |
| 248 | - | ||
| 249 | 245 | // --- Network process memory pressure --- | |
| 250 | 246 | // NetworkProcessMemoryLimitMB sets memory limit in MB for network process. | |
| 251 | 247 | // Default: 0 (unset) | |
| @@ -262,10 +258,6 @@ type PerformanceConfig struct { | |||
| 262 | 258 | // NetworkProcessMemoryStrictThreshold sets threshold for strict memory release. | |
| 263 | 259 | // Valid: (0, 1). Default: 0 (unset) | |
| 264 | 260 | NetworkProcessMemoryStrictThreshold float64 `mapstructure:"network_process_memory_strict_threshold" yaml:"network_process_memory_strict_threshold" toml:"network_process_memory_strict_threshold"` //nolint:lll // struct tags must stay on one line | |
| 265 | - | ||
| 266 | - | // NetworkProcessMemoryKillThreshold sets threshold for killing network process. | |
| 267 | - | // Default: -1 (unset). Value 0 means never kill. | |
| 268 | - | NetworkProcessMemoryKillThreshold float64 `mapstructure:"network_process_memory_kill_threshold" yaml:"network_process_memory_kill_threshold" toml:"network_process_memory_kill_threshold"` //nolint:lll // struct tags must stay on one line | |
| 269 | 261 | } | |
| 270 | 262 | ||
| 271 | 263 | // SearchShortcut represents a search shortcut configuration. | |
| @@ -242,10 +242,6 @@ type PerformanceConfig struct { | |||||
| 242 | // Valid: (0, 1). Default: 0 (unset, uses WebKit default: 0.5) | 242 | // Valid: (0, 1). Default: 0 (unset, uses WebKit default: 0.5) | ||
| 243 | WebProcessMemoryStrictThreshold float64 `mapstructure:"web_process_memory_strict_threshold" yaml:"web_process_memory_strict_threshold" toml:"web_process_memory_strict_threshold"` //nolint:lll // struct tags must stay on one line | 243 | WebProcessMemoryStrictThreshold float64 `mapstructure:"web_process_memory_strict_threshold" yaml:"web_process_memory_strict_threshold" toml:"web_process_memory_strict_threshold"` //nolint:lll // struct tags must stay on one line | ||
| 244 | 244 | ||||
| 245 | - | // WebProcessMemoryKillThreshold sets threshold for killing processes. | |||
| 246 | - | // Default: -1 (unset). Value 0 means never kill. | |||
| 247 | - | WebProcessMemoryKillThreshold float64 `mapstructure:"web_process_memory_kill_threshold" yaml:"web_process_memory_kill_threshold" toml:"web_process_memory_kill_threshold"` //nolint:lll // struct tags must stay on one line | |||
| 248 | - | ||||
| 249 | // --- Network process memory pressure --- | 245 | // --- Network process memory pressure --- | ||
| 250 | // NetworkProcessMemoryLimitMB sets memory limit in MB for network process. | 246 | // NetworkProcessMemoryLimitMB sets memory limit in MB for network process. | ||
| 251 | // Default: 0 (unset) | 247 | // Default: 0 (unset) | ||
| @@ -262,10 +258,6 @@ type PerformanceConfig struct { | |||||
| 262 | // NetworkProcessMemoryStrictThreshold sets threshold for strict memory release. | 258 | // NetworkProcessMemoryStrictThreshold sets threshold for strict memory release. | ||
| 263 | // Valid: (0, 1). Default: 0 (unset) | 259 | // Valid: (0, 1). Default: 0 (unset) | ||
| 264 | NetworkProcessMemoryStrictThreshold float64 `mapstructure:"network_process_memory_strict_threshold" yaml:"network_process_memory_strict_threshold" toml:"network_process_memory_strict_threshold"` //nolint:lll // struct tags must stay on one line | 260 | NetworkProcessMemoryStrictThreshold float64 `mapstructure:"network_process_memory_strict_threshold" yaml:"network_process_memory_strict_threshold" toml:"network_process_memory_strict_threshold"` //nolint:lll // struct tags must stay on one line | ||
| 265 | - | ||||
| 266 | - | // NetworkProcessMemoryKillThreshold sets threshold for killing network process. | |||
| 267 | - | // Default: -1 (unset). Value 0 means never kill. | |||
| 268 | - | NetworkProcessMemoryKillThreshold float64 `mapstructure:"network_process_memory_kill_threshold" yaml:"network_process_memory_kill_threshold" toml:"network_process_memory_kill_threshold"` //nolint:lll // struct tags must stay on one line | |||
| 269 | } | 261 | } | ||
| 270 | 262 | ||||
| 271 | // SearchShortcut represents a search shortcut configuration. | 263 | // SearchShortcut represents a search shortcut configuration. | ||
M internal/infrastructure/webkit/context.go +0 -1
| @@ -85,7 +85,6 @@ func NewWebKitContextWithOptions(ctx context.Context, opts port.WebKitContextOpt | |||
| 85 | 85 | Float64("poll_sec", opts.WebProcessMemory.PollIntervalSec). | |
| 86 | 86 | Float64("conservative", opts.WebProcessMemory.ConservativeThreshold). | |
| 87 | 87 | Float64("strict", opts.WebProcessMemory.StrictThreshold). | |
| 88 | - | Float64("kill", opts.WebProcessMemory.KillThreshold). | |
| 89 | 88 | Msg("created WebContext with memory pressure settings") | |
| 90 | 89 | } | |
| 91 | 90 | } | |
| @@ -85,7 +85,6 @@ func NewWebKitContextWithOptions(ctx context.Context, opts port.WebKitContextOpt | |||||
| 85 | Float64("poll_sec", opts.WebProcessMemory.PollIntervalSec). | 85 | Float64("poll_sec", opts.WebProcessMemory.PollIntervalSec). | ||
| 86 | Float64("conservative", opts.WebProcessMemory.ConservativeThreshold). | 86 | Float64("conservative", opts.WebProcessMemory.ConservativeThreshold). | ||
| 87 | Float64("strict", opts.WebProcessMemory.StrictThreshold). | 87 | Float64("strict", opts.WebProcessMemory.StrictThreshold). | ||
| 88 | - | Float64("kill", opts.WebProcessMemory.KillThreshold). | |||
| 89 | Msg("created WebContext with memory pressure settings") | 88 | Msg("created WebContext with memory pressure settings") | ||
| 90 | } | 89 | } | ||
| 91 | } | 90 | } | ||
M internal/infrastructure/webkit/memory_pressure.go +0 -7
| @@ -41,7 +41,6 @@ func (*MemoryPressureApplier) ApplyNetworkProcessSettings(ctx context.Context, c | |||
| 41 | 41 | Float64("poll_sec", cfg.PollIntervalSec). | |
| 42 | 42 | Float64("conservative", cfg.ConservativeThreshold). | |
| 43 | 43 | Float64("strict", cfg.StrictThreshold). | |
| 44 | - | Float64("kill", cfg.KillThreshold). | |
| 45 | 44 | Msg("applied network process memory pressure settings") | |
| 46 | 45 | ||
| 47 | 46 | return nil | |
| @@ -72,7 +71,6 @@ func (*MemoryPressureApplier) ApplyWebProcessSettings(ctx context.Context, cfg * | |||
| 72 | 71 | Float64("poll_sec", cfg.PollIntervalSec). | |
| 73 | 72 | Float64("conservative", cfg.ConservativeThreshold). | |
| 74 | 73 | Float64("strict", cfg.StrictThreshold). | |
| 75 | - | Float64("kill", cfg.KillThreshold). | |
| 76 | 74 | Msg("prepared web process memory pressure settings") | |
| 77 | 75 | ||
| 78 | 76 | return settings, nil | |
| @@ -112,11 +110,6 @@ func buildMemoryPressureSettings(cfg *port.MemoryPressureConfig) *webkit.MemoryP | |||
| 112 | 110 | } | |
| 113 | 111 | } | |
| 114 | 112 | ||
| 115 | - | // Kill threshold: -1 = unset, 0 = never kill, >0 = threshold | |
| 116 | - | if cfg.KillThreshold >= 0 { | |
| 117 | - | settings.SetKillThreshold(cfg.KillThreshold) | |
| 118 | - | } | |
| 119 | - | ||
| 120 | 113 | return settings | |
| 121 | 114 | } | |
| 122 | 115 | ||
| @@ -41,7 +41,6 @@ func (*MemoryPressureApplier) ApplyNetworkProcessSettings(ctx context.Context, c | |||||
| 41 | Float64("poll_sec", cfg.PollIntervalSec). | 41 | Float64("poll_sec", cfg.PollIntervalSec). | ||
| 42 | Float64("conservative", cfg.ConservativeThreshold). | 42 | Float64("conservative", cfg.ConservativeThreshold). | ||
| 43 | Float64("strict", cfg.StrictThreshold). | 43 | Float64("strict", cfg.StrictThreshold). | ||
| 44 | - | Float64("kill", cfg.KillThreshold). | |||
| 45 | Msg("applied network process memory pressure settings") | 44 | Msg("applied network process memory pressure settings") | ||
| 46 | 45 | ||||
| 47 | return nil | 46 | return nil | ||
| @@ -72,7 +71,6 @@ func (*MemoryPressureApplier) ApplyWebProcessSettings(ctx context.Context, cfg * | |||||
| 72 | Float64("poll_sec", cfg.PollIntervalSec). | 71 | Float64("poll_sec", cfg.PollIntervalSec). | ||
| 73 | Float64("conservative", cfg.ConservativeThreshold). | 72 | Float64("conservative", cfg.ConservativeThreshold). | ||
| 74 | Float64("strict", cfg.StrictThreshold). | 73 | Float64("strict", cfg.StrictThreshold). | ||
| 75 | - | Float64("kill", cfg.KillThreshold). | |||
| 76 | Msg("prepared web process memory pressure settings") | 74 | Msg("prepared web process memory pressure settings") | ||
| 77 | 75 | ||||
| 78 | return settings, nil | 76 | return settings, nil | ||
| @@ -112,11 +110,6 @@ func buildMemoryPressureSettings(cfg *port.MemoryPressureConfig) *webkit.MemoryP | |||||
| 112 | } | 110 | } | ||
| 113 | } | 111 | } | ||
| 114 | 112 | ||||
| 115 | - | // Kill threshold: -1 = unset, 0 = never kill, >0 = threshold | |||
| 116 | - | if cfg.KillThreshold >= 0 { | |||
| 117 | - | settings.SetKillThreshold(cfg.KillThreshold) | |||
| 118 | - | } | |||
| 119 | - | ||||
| 120 | return settings | 113 | return settings | ||
| 121 | } | 114 | } | ||
| 122 | 115 | ||||
M internal/infrastructure/webkit/scheme_handler.go +0 -2
| @@ -114,7 +114,6 @@ type configResolvedPerformance struct { | |||
| 114 | 114 | WebViewPoolPrewarm int `json:"webview_pool_prewarm"` | |
| 115 | 115 | ConservativeThreshold float64 `json:"conservative_threshold"` | |
| 116 | 116 | StrictThreshold float64 `json:"strict_threshold"` | |
| 117 | - | KillThreshold float64 `json:"kill_threshold"` | |
| 118 | 117 | } | |
| 119 | 118 | ||
| 120 | 119 | type configPayload struct { | |
| @@ -224,7 +223,6 @@ func (h *DumbSchemeHandler) buildConfigResponse(cfg *config.Config) *SchemeRespo | |||
| 224 | 223 | WebViewPoolPrewarm: resolved.WebViewPoolPrewarmCount, | |
| 225 | 224 | ConservativeThreshold: resolved.WebProcessMemoryConservativeThreshold, | |
| 226 | 225 | StrictThreshold: resolved.WebProcessMemoryStrictThreshold, | |
| 227 | - | KillThreshold: resolved.WebProcessMemoryKillThreshold, | |
| 228 | 226 | }, | |
| 229 | 227 | Hardware: buildHardwarePayload(hw), | |
| 230 | 228 | }, | |
| @@ -114,7 +114,6 @@ type configResolvedPerformance struct { | |||||
| 114 | WebViewPoolPrewarm int `json:"webview_pool_prewarm"` | 114 | WebViewPoolPrewarm int `json:"webview_pool_prewarm"` | ||
| 115 | ConservativeThreshold float64 `json:"conservative_threshold"` | 115 | ConservativeThreshold float64 `json:"conservative_threshold"` | ||
| 116 | StrictThreshold float64 `json:"strict_threshold"` | 116 | StrictThreshold float64 `json:"strict_threshold"` | ||
| 117 | - | KillThreshold float64 `json:"kill_threshold"` | |||
| 118 | } | 117 | } | ||
| 119 | 118 | ||||
| 120 | type configPayload struct { | 119 | type configPayload struct { | ||
| @@ -224,7 +223,6 @@ func (h *DumbSchemeHandler) buildConfigResponse(cfg *config.Config) *SchemeRespo | |||||
| 224 | WebViewPoolPrewarm: resolved.WebViewPoolPrewarmCount, | 223 | WebViewPoolPrewarm: resolved.WebViewPoolPrewarmCount, | ||
| 225 | ConservativeThreshold: resolved.WebProcessMemoryConservativeThreshold, | 224 | ConservativeThreshold: resolved.WebProcessMemoryConservativeThreshold, | ||
| 226 | StrictThreshold: resolved.WebProcessMemoryStrictThreshold, | 225 | StrictThreshold: resolved.WebProcessMemoryStrictThreshold, | ||
| 227 | - | KillThreshold: resolved.WebProcessMemoryKillThreshold, | |||
| 228 | }, | 226 | }, | ||
| 229 | Hardware: buildHardwarePayload(hw), | 227 | Hardware: buildHardwarePayload(hw), | ||
| 230 | }, | 228 | }, | ||
M webui/src/pages/ConfigPage.svelte +0 -8
| @@ -36,7 +36,6 @@ | |||
| 36 | 36 | webview_pool_prewarm: number; | |
| 37 | 37 | conservative_threshold: number; | |
| 38 | 38 | strict_threshold: number; | |
| 39 | - | kill_threshold: number; | |
| 40 | 39 | }; | |
| 41 | 40 | ||
| 42 | 41 | type HardwareInfo = { | |
| @@ -596,13 +595,6 @@ | |||
| 596 | 595 | </div> | |
| 597 | 596 | <p class="text-xs text-muted-foreground">Pre-created WebViews at startup for faster new tab/pane creation.</p> | |
| 598 | 597 | </div> | |
| 599 | - | <div class="space-y-1"> | |
| 600 | - | <div class="flex justify-between"> | |
| 601 | - | <span class="font-medium">Memory Kill Threshold</span> | |
| 602 | - | <span class="font-mono">{config.performance.resolved.kill_threshold === -1 ? 'never' : (config.performance.resolved.kill_threshold * 100).toFixed(0) + '%'}</span> | |
| 603 | - | </div> | |
| 604 | - | <p class="text-xs text-muted-foreground">When memory usage exceeds this threshold, WebKit may terminate the process to free memory.</p> | |
| 605 | - | </div> | |
| 606 | 598 | </div> | |
| 607 | 599 | </div> | |
| 608 | 600 | {/if} | |
| @@ -36,7 +36,6 @@ | |||||
| 36 | webview_pool_prewarm: number; | 36 | webview_pool_prewarm: number; | ||
| 37 | conservative_threshold: number; | 37 | conservative_threshold: number; | ||
| 38 | strict_threshold: number; | 38 | strict_threshold: number; | ||
| 39 | - | kill_threshold: number; | |||
| 40 | }; | 39 | }; | ||
| 41 | 40 | ||||
| 42 | type HardwareInfo = { | 41 | type HardwareInfo = { | ||
| @@ -596,13 +595,6 @@ | |||||
| 596 | </div> | 595 | </div> | ||
| 597 | <p class="text-xs text-muted-foreground">Pre-created WebViews at startup for faster new tab/pane creation.</p> | 596 | <p class="text-xs text-muted-foreground">Pre-created WebViews at startup for faster new tab/pane creation.</p> | ||
| 598 | </div> | 597 | </div> | ||
| 599 | - | <div class="space-y-1"> | |||
| 600 | - | <div class="flex justify-between"> | |||
| 601 | - | <span class="font-medium">Memory Kill Threshold</span> | |||
| 602 | - | <span class="font-mono">{config.performance.resolved.kill_threshold === -1 ? 'never' : (config.performance.resolved.kill_threshold * 100).toFixed(0) + '%'}</span> | |||
| 603 | - | </div> | |||
| 604 | - | <p class="text-xs text-muted-foreground">When memory usage exceeds this threshold, WebKit may terminate the process to free memory.</p> | |||
| 605 | - | </div> | |||
| 606 | </div> | 598 | </div> | ||
| 607 | </div> | 599 | </div> | ||
| 608 | {/if} | 600 | {/if} | ||