detached 436a28a

Merge pull request #72 from bnema/fix/remove-memory-kill-threshold

fix(perf): remove memory kill threshold
commit
436a28a7d7fca156ffa648d1f93b069b356c4fc6
author
bnema · · 2025-12-30 04:34 UTC
committer
GitHub · · 2025-12-30 04:34 UTC
merge of
f422341 + 699ad8c · diff against the first parent
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
13 files · +55 -157
M docs/CONFIG.md +6 -10
@@ -521,13 +521,12 @@ Performance profiles provide preset configurations for WebKitGTK tuning. These s
521521 | Setting | default | lite | max |
522522 |---------|---------|------|-----|
523523 | 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 |
531530
532531 **Example:**
533532 ```toml
@@ -557,12 +556,10 @@ When `profile = "custom"`, you can configure individual tuning options:
557556 | `performance.web_process_memory_poll_interval_sec` | float | `0` | Memory check interval (0=WebKit default: 30s) |
558557 | `performance.web_process_memory_conservative_threshold` | float | `0` | Conservative cleanup threshold (0=unset) |
559558 | `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) |
561559 | `performance.network_process_memory_limit_mb` | int | `0` | Network process memory limit in MB |
562560 | `performance.network_process_memory_poll_interval_sec` | float | `0` | Network memory check interval |
563561 | `performance.network_process_memory_conservative_threshold` | float | `0` | Network conservative threshold |
564562 | `performance.network_process_memory_strict_threshold` | float | `0` | Network strict threshold |
565-| `performance.network_process_memory_kill_threshold` | float | `-1` | Network process kill threshold |
566563 | `performance.webview_pool_prewarm_count` | int | `4` | WebViews to pre-create at startup |
567564 | `performance.zoom_cache_size` | int | `256` | Domain zoom levels to cache |
568565
@@ -579,7 +576,6 @@ skia_gpu_painting_threads = 2
579576 web_process_memory_limit_mb = 1024
580577 web_process_memory_conservative_threshold = 0.4
581578 web_process_memory_strict_threshold = 0.6
582-web_process_memory_kill_threshold = -1 # Never kill
583579
584580 # WebView pool
585581 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 ```toml532 ```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 = 1024576 web_process_memory_limit_mb = 1024
580 web_process_memory_conservative_threshold = 0.4577 web_process_memory_conservative_threshold = 0.4
581 web_process_memory_strict_threshold = 0.6578 web_process_memory_strict_threshold = 0.6
582-web_process_memory_kill_threshold = -1 # Never kill
583 579
584 # WebView pool580 # WebView pool
585 webview_pool_prewarm_count = 6581 webview_pool_prewarm_count = 6
M internal/application/port/webkit_context.go +2 -7
@@ -4,7 +4,7 @@ package port
44 import "context"
55
66 // 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".
88 type MemoryPressureConfig struct {
99 // MemoryLimitMB sets the memory limit in megabytes.
1010 // 0 means unset (uses WebKit default: system RAM capped at 3GB).
@@ -21,10 +21,6 @@ type MemoryPressureConfig struct {
2121 // StrictThreshold sets threshold for strict memory release.
2222 // Must be in (0, 1). 0 means unset (uses WebKit default: 0.5).
2323 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
2824 }
2925
3026 // IsConfigured returns true if any memory pressure setting is configured.
@@ -35,8 +31,7 @@ func (c *MemoryPressureConfig) IsConfigured() bool {
3531 return c.MemoryLimitMB > 0 ||
3632 c.PollIntervalSec > 0 ||
3733 c.ConservativeThreshold > 0 ||
38- c.StrictThreshold > 0 ||
39- c.KillThreshold >= 0
34+ c.StrictThreshold > 0
4035 }
4136
4237 // 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 float6423 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) {
1919 expected: false,
2020 },
2121 {
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{},
2624 expected: false,
2725 },
2826 {
@@ -53,27 +51,6 @@ func TestMemoryPressureConfig_IsConfigured(t *testing.T) {
5351 },
5452 expected: true,
5553 },
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- },
7754 {
7855 name: "all defaults (unset)",
7956 config: &port.MemoryPressureConfig{
@@ -81,7 +58,6 @@ func TestMemoryPressureConfig_IsConfigured(t *testing.T) {
8158 PollIntervalSec: 0,
8259 ConservativeThreshold: 0,
8360 StrictThreshold: 0,
84- KillThreshold: -1,
8561 },
8662 expected: false,
8763 },
@@ -92,7 +68,6 @@ func TestMemoryPressureConfig_IsConfigured(t *testing.T) {
9268 PollIntervalSec: 15.0,
9369 ConservativeThreshold: 0.25,
9470 StrictThreshold: 0.6,
95- KillThreshold: 0.9,
9671 },
9772 expected: true,
9873 },
@@ -118,11 +93,9 @@ func TestWebKitContextOptions_IsWebProcessMemoryConfigured(t *testing.T) {
11893 expected: false,
11994 },
12095 {
121- name: "empty WebProcessMemory with default kill threshold",
96+ name: "empty WebProcessMemory",
12297 opts: port.WebKitContextOptions{
123- WebProcessMemory: &port.MemoryPressureConfig{
124- KillThreshold: -1, // explicit unset
125- },
98+ WebProcessMemory: &port.MemoryPressureConfig{},
12699 },
127100 expected: false,
128101 },
@@ -157,11 +130,9 @@ func TestWebKitContextOptions_IsNetworkProcessMemoryConfigured(t *testing.T) {
157130 expected: false,
158131 },
159132 {
160- name: "empty NetworkProcessMemory with default kill threshold",
133+ name: "empty NetworkProcessMemory",
161134 opts: port.WebKitContextOptions{
162- NetworkProcessMemory: &port.MemoryPressureConfig{
163- KillThreshold: -1, // explicit unset
164- },
135+ NetworkProcessMemory: &port.MemoryPressureConfig{},
165136 },
166137 expected: false,
167138 },
@@ -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 {
7979 PollIntervalSec: perfSettings.WebProcessMemoryPollIntervalSec,
8080 ConservativeThreshold: perfSettings.WebProcessMemoryConservativeThreshold,
8181 StrictThreshold: perfSettings.WebProcessMemoryStrictThreshold,
82- KillThreshold: perfSettings.WebProcessMemoryKillThreshold,
8382 }
8483 }
8584
@@ -90,7 +89,6 @@ func BuildWebKitStack(input WebKitStackInput) WebKitStack {
9089 PollIntervalSec: perfSettings.NetworkProcessMemoryPollIntervalSec,
9190 ConservativeThreshold: perfSettings.NetworkProcessMemoryConservativeThreshold,
9291 StrictThreshold: perfSettings.NetworkProcessMemoryStrictThreshold,
93- KillThreshold: perfSettings.NetworkProcessMemoryKillThreshold,
9492 }
9593 }
9694
@@ -165,8 +163,7 @@ func hasWebProcessMemoryConfig(p *config.ResolvedPerformanceSettings) bool {
165163 return p.WebProcessMemoryLimitMB > 0 ||
166164 p.WebProcessMemoryPollIntervalSec > 0 ||
167165 p.WebProcessMemoryConservativeThreshold > 0 ||
168- p.WebProcessMemoryStrictThreshold > 0 ||
169- p.WebProcessMemoryKillThreshold >= 0
166+ p.WebProcessMemoryStrictThreshold > 0
170167 }
171168
172169 // hasNetworkProcessMemoryConfig returns true if any network process memory setting is configured.
@@ -174,8 +171,7 @@ func hasNetworkProcessMemoryConfig(p *config.ResolvedPerformanceSettings) bool {
174171 return p.NetworkProcessMemoryLimitMB > 0 ||
175172 p.NetworkProcessMemoryPollIntervalSec > 0 ||
176173 p.NetworkProcessMemoryConservativeThreshold > 0 ||
177- p.NetworkProcessMemoryStrictThreshold > 0 ||
178- p.NetworkProcessMemoryKillThreshold >= 0
174+ p.NetworkProcessMemoryStrictThreshold > 0
179175 }
180176
181177 // 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 (
6969 // Skia threading defaults (0 = unset, -1 = unset for GPU threads)
7070 defaultSkiaCPUPaintingThreads = 0
7171 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
7572 )
7673
7774 // getDefaultLogDir returns the default log directory, falls back to empty string on error
@@ -302,13 +299,11 @@ func DefaultConfig() *Config {
302299 WebProcessMemoryPollIntervalSec: 0,
303300 WebProcessMemoryConservativeThreshold: 0,
304301 WebProcessMemoryStrictThreshold: 0,
305- WebProcessMemoryKillThreshold: defaultMemoryPressureKillThreshold,
306302 // Network process memory pressure - all unset by default
307303 NetworkProcessMemoryLimitMB: 0,
308304 NetworkProcessMemoryPollIntervalSec: 0,
309305 NetworkProcessMemoryConservativeThreshold: 0,
310306 NetworkProcessMemoryStrictThreshold: 0,
311- NetworkProcessMemoryKillThreshold: defaultMemoryPressureKillThreshold,
312307 },
313308 Update: UpdateConfig{
314309 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 = 070 defaultSkiaCPUPaintingThreads = 0
71 defaultSkiaGPUPaintingThreads = -1 // -1 means unset; 0 would disable GPU tile painting71 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 error74 // 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 default302 // 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 default309 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) {
492492 m.viper.SetDefault("performance.web_process_memory_poll_interval_sec", defaults.Performance.WebProcessMemoryPollIntervalSec)
493493 m.viper.SetDefault("performance.web_process_memory_conservative_threshold", defaults.Performance.WebProcessMemoryConservativeThreshold)
494494 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)
496495 // Network process memory pressure
497496 m.viper.SetDefault("performance.network_process_memory_limit_mb", defaults.Performance.NetworkProcessMemoryLimitMB)
498497 m.viper.SetDefault("performance.network_process_memory_poll_interval_sec", defaults.Performance.NetworkProcessMemoryPollIntervalSec)
499498 netConservativeThreshold := defaults.Performance.NetworkProcessMemoryConservativeThreshold
500499 m.viper.SetDefault("performance.network_process_memory_conservative_threshold", netConservativeThreshold)
501500 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)
503501 }
504502
505503 // 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 pressure495 // 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.NetworkProcessMemoryConservativeThreshold498 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 {
6565 WebProcessMemoryPollIntervalSec float64
6666 WebProcessMemoryConservativeThreshold float64
6767 WebProcessMemoryStrictThreshold float64
68- WebProcessMemoryKillThreshold float64
6968
7069 // Network process memory pressure
7170 NetworkProcessMemoryLimitMB int
7271 NetworkProcessMemoryPollIntervalSec float64
7372 NetworkProcessMemoryConservativeThreshold float64
7473 NetworkProcessMemoryStrictThreshold float64
75- NetworkProcessMemoryKillThreshold float64
7674
7775 // WebView pool
7876 WebViewPoolPrewarmCount int
@@ -108,13 +106,11 @@ func resolveDefaultProfile() ResolvedPerformanceSettings {
108106 WebProcessMemoryPollIntervalSec: 0,
109107 WebProcessMemoryConservativeThreshold: 0,
110108 WebProcessMemoryStrictThreshold: 0,
111- WebProcessMemoryKillThreshold: -1,
112109
113110 NetworkProcessMemoryLimitMB: 0,
114111 NetworkProcessMemoryPollIntervalSec: 0,
115112 NetworkProcessMemoryConservativeThreshold: 0,
116113 NetworkProcessMemoryStrictThreshold: 0,
117- NetworkProcessMemoryKillThreshold: -1,
118114
119115 WebViewPoolPrewarmCount: 4,
120116 }
@@ -134,17 +130,15 @@ func resolveLiteProfile(hw *port.HardwareInfo) ResolvedPerformanceSettings {
134130 SkiaGPUPaintingThreads: -1, // unset
135131 SkiaEnableCPURendering: false,
136132
137- WebProcessMemoryLimitMB: 512,
133+ WebProcessMemoryLimitMB: 768,
138134 WebProcessMemoryPollIntervalSec: 0, // use WebKit default (30s)
139135 WebProcessMemoryConservativeThreshold: 0.25,
140136 WebProcessMemoryStrictThreshold: 0.4,
141- WebProcessMemoryKillThreshold: 0.8,
142137
143- NetworkProcessMemoryLimitMB: 256,
138+ NetworkProcessMemoryLimitMB: 384,
144139 NetworkProcessMemoryPollIntervalSec: 0,
145140 NetworkProcessMemoryConservativeThreshold: 0.25,
146141 NetworkProcessMemoryStrictThreshold: 0.4,
147- NetworkProcessMemoryKillThreshold: 0.8,
148142
149143 WebViewPoolPrewarmCount: 2,
150144 }
@@ -159,9 +153,6 @@ func resolveMaxProfile(hw *port.HardwareInfo) ResolvedPerformanceSettings {
159153 // GPU threads: scale based on VRAM
160154 gpuThreads := computeMaxGPUThreads(hw)
161155
162- // Memory limits: scale based on system RAM
163- webMemMB, netMemMB := computeMaxMemoryLimits(hw)
164-
165156 // WebView pool: scale based on RAM
166157 poolPrewarm := computeMaxPoolPrewarm(hw)
167158
@@ -170,17 +161,16 @@ func resolveMaxProfile(hw *port.HardwareInfo) ResolvedPerformanceSettings {
170161 SkiaGPUPaintingThreads: gpuThreads,
171162 SkiaEnableCPURendering: false,
172163
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,
178169
179- NetworkProcessMemoryLimitMB: netMemMB,
170+ NetworkProcessMemoryLimitMB: 0,
180171 NetworkProcessMemoryPollIntervalSec: 0,
181- NetworkProcessMemoryConservativeThreshold: 0.5,
182- NetworkProcessMemoryStrictThreshold: 0.7,
183- NetworkProcessMemoryKillThreshold: -1,
172+ NetworkProcessMemoryConservativeThreshold: 0,
173+ NetworkProcessMemoryStrictThreshold: 0,
184174
185175 WebViewPoolPrewarmCount: poolPrewarm,
186176 }
@@ -280,13 +270,11 @@ func resolveCustomProfile(cfg *PerformanceConfig) ResolvedPerformanceSettings {
280270 WebProcessMemoryPollIntervalSec: cfg.WebProcessMemoryPollIntervalSec,
281271 WebProcessMemoryConservativeThreshold: cfg.WebProcessMemoryConservativeThreshold,
282272 WebProcessMemoryStrictThreshold: cfg.WebProcessMemoryStrictThreshold,
283- WebProcessMemoryKillThreshold: cfg.WebProcessMemoryKillThreshold,
284273
285274 NetworkProcessMemoryLimitMB: cfg.NetworkProcessMemoryLimitMB,
286275 NetworkProcessMemoryPollIntervalSec: cfg.NetworkProcessMemoryPollIntervalSec,
287276 NetworkProcessMemoryConservativeThreshold: cfg.NetworkProcessMemoryConservativeThreshold,
288277 NetworkProcessMemoryStrictThreshold: cfg.NetworkProcessMemoryStrictThreshold,
289- NetworkProcessMemoryKillThreshold: cfg.NetworkProcessMemoryKillThreshold,
290278
291279 WebViewPoolPrewarmCount: cfg.WebViewPoolPrewarmCount,
292280 }
@@ -302,12 +290,10 @@ func HasCustomPerformanceFields(cfg *PerformanceConfig) bool {
302290 cfg.WebProcessMemoryPollIntervalSec != 0 ||
303291 cfg.WebProcessMemoryConservativeThreshold != 0 ||
304292 cfg.WebProcessMemoryStrictThreshold != 0 ||
305- cfg.WebProcessMemoryKillThreshold != -1 ||
306293 cfg.NetworkProcessMemoryLimitMB != 0 ||
307294 cfg.NetworkProcessMemoryPollIntervalSec != 0 ||
308295 cfg.NetworkProcessMemoryConservativeThreshold != 0 ||
309- cfg.NetworkProcessMemoryStrictThreshold != 0 ||
310- cfg.NetworkProcessMemoryKillThreshold != -1
296+ cfg.NetworkProcessMemoryStrictThreshold != 0
311297 }
312298
313299 // IsValidPerformanceProfile returns true if the profile name is recognized.
@@ -65,14 +65,12 @@ type ResolvedPerformanceSettings struct {
65 WebProcessMemoryPollIntervalSec float6465 WebProcessMemoryPollIntervalSec float64
66 WebProcessMemoryConservativeThreshold float6466 WebProcessMemoryConservativeThreshold float64
67 WebProcessMemoryStrictThreshold float6467 WebProcessMemoryStrictThreshold float64
68- WebProcessMemoryKillThreshold float64
69 68
70 // Network process memory pressure69 // Network process memory pressure
71 NetworkProcessMemoryLimitMB int70 NetworkProcessMemoryLimitMB int
72 NetworkProcessMemoryPollIntervalSec float6471 NetworkProcessMemoryPollIntervalSec float64
73 NetworkProcessMemoryConservativeThreshold float6472 NetworkProcessMemoryConservativeThreshold float64
74 NetworkProcessMemoryStrictThreshold float6473 NetworkProcessMemoryStrictThreshold float64
75- NetworkProcessMemoryKillThreshold float64
76 74
77 // WebView pool75 // WebView pool
78 WebViewPoolPrewarmCount int76 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, // unset130 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 VRAM153 // 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 RAM156 // 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 default165+ WebProcessMemoryLimitMB: 0,
175- WebProcessMemoryConservativeThreshold: 0.5,166+ WebProcessMemoryPollIntervalSec: 0,
176- WebProcessMemoryStrictThreshold: 0.7,167+ WebProcessMemoryConservativeThreshold: 0,
177- WebProcessMemoryKillThreshold: -1, // never kill168+ 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) {
5555 if result.SkiaCPUPaintingThreads != 2 {
5656 t.Errorf("expected SkiaCPUPaintingThreads=2, got %d", result.SkiaCPUPaintingThreads)
5757 }
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)
6060 }
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)
6363 }
6464 if result.WebViewPoolPrewarmCount != 2 {
6565 t.Errorf("expected WebViewPoolPrewarmCount=2, got %d", result.WebViewPoolPrewarmCount)
6666 }
67- if result.WebProcessMemoryKillThreshold != 0.8 {
68- t.Errorf("expected WebProcessMemoryKillThreshold=0.8, got %f", result.WebProcessMemoryKillThreshold)
69- }
7067 }
7168
7269 func TestResolvePerformanceProfile_Lite_LowCoreSystem(t *testing.T) {
@@ -109,16 +106,13 @@ func TestResolvePerformanceProfile_Max_NoHardware(t *testing.T) {
109106 if result.SkiaGPUPaintingThreads != 2 {
110107 t.Errorf("expected SkiaGPUPaintingThreads=2 (fallback), got %d", result.SkiaGPUPaintingThreads)
111108 }
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)
115112 }
116113 if result.WebViewPoolPrewarmCount != 8 {
117114 t.Errorf("expected WebViewPoolPrewarmCount=8, got %d", result.WebViewPoolPrewarmCount)
118115 }
119- if result.WebProcessMemoryKillThreshold != -1 {
120- t.Errorf("expected WebProcessMemoryKillThreshold=-1 (never kill), got %f", result.WebProcessMemoryKillThreshold)
121- }
122116 }
123117
124118 func TestResolvePerformanceProfile_Max_HighEndSystem(t *testing.T) {
@@ -143,12 +137,12 @@ func TestResolvePerformanceProfile_Max_HighEndSystem(t *testing.T) {
143137 if result.SkiaGPUPaintingThreads != 8 {
144138 t.Errorf("expected SkiaGPUPaintingThreads=8 for 16GB VRAM, got %d", result.SkiaGPUPaintingThreads)
145139 }
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)
149143 }
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)
152146 }
153147 // Pool prewarm: high-end tier
154148 if result.WebViewPoolPrewarmCount != 12 {
@@ -178,9 +172,9 @@ func TestResolvePerformanceProfile_Max_MidRangeSystem(t *testing.T) {
178172 if result.SkiaGPUPaintingThreads != 6 {
179173 t.Errorf("expected SkiaGPUPaintingThreads=6 for 8GB VRAM, got %d", result.SkiaGPUPaintingThreads)
180174 }
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)
184178 }
185179 // Pool prewarm: mid-range tier
186180 if result.WebViewPoolPrewarmCount != 8 {
@@ -210,9 +204,9 @@ func TestResolvePerformanceProfile_Max_LowEndSystem(t *testing.T) {
210204 if result.SkiaGPUPaintingThreads != 2 {
211205 t.Errorf("expected SkiaGPUPaintingThreads=2 for 2GB VRAM, got %d", result.SkiaGPUPaintingThreads)
212206 }
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)
216210 }
217211 // Pool prewarm: low tier
218212 if result.WebViewPoolPrewarmCount != 4 {
@@ -267,40 +261,33 @@ func TestHasCustomPerformanceFields(t *testing.T) {
267261 {
268262 name: "all defaults - no custom fields",
269263 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,
275267 },
276268 expected: false,
277269 },
278270 {
279271 name: "skia cpu threads set",
280272 cfg: PerformanceConfig{
281- SkiaCPUPaintingThreads: 4,
282- SkiaGPUPaintingThreads: -1,
283- WebProcessMemoryKillThreshold: -1,
284- NetworkProcessMemoryKillThreshold: -1,
273+ SkiaCPUPaintingThreads: 4,
274+ SkiaGPUPaintingThreads: -1,
285275 },
286276 expected: true,
287277 },
288278 {
289279 name: "memory limit set",
290280 cfg: PerformanceConfig{
291- SkiaGPUPaintingThreads: -1,
292- WebProcessMemoryLimitMB: 1024,
293- WebProcessMemoryKillThreshold: -1,
294- NetworkProcessMemoryKillThreshold: -1,
281+ SkiaGPUPaintingThreads: -1,
282+ WebProcessMemoryLimitMB: 1024,
295283 },
296284 expected: true,
297285 },
298286 {
299- name: "kill threshold changed from -1",
287+ name: "conservative threshold set",
300288 cfg: PerformanceConfig{
301- SkiaGPUPaintingThreads: -1,
302- WebProcessMemoryKillThreshold: 0.9,
303- NetworkProcessMemoryKillThreshold: -1,
289+ SkiaGPUPaintingThreads: -1,
290+ WebProcessMemoryConservativeThreshold: 0.4,
304291 },
305292 expected: true,
306293 },
@@ -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 system109+ // 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 tier147 // 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 tier179 // 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 tier211 // 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 {
242242 // Valid: (0, 1). Default: 0 (unset, uses WebKit default: 0.5)
243243 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
244244
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-
249245 // --- Network process memory pressure ---
250246 // NetworkProcessMemoryLimitMB sets memory limit in MB for network process.
251247 // Default: 0 (unset)
@@ -262,10 +258,6 @@ type PerformanceConfig struct {
262258 // NetworkProcessMemoryStrictThreshold sets threshold for strict memory release.
263259 // Valid: (0, 1). Default: 0 (unset)
264260 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
269261 }
270262
271263 // 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 line243 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 line260 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
8585 Float64("poll_sec", opts.WebProcessMemory.PollIntervalSec).
8686 Float64("conservative", opts.WebProcessMemory.ConservativeThreshold).
8787 Float64("strict", opts.WebProcessMemory.StrictThreshold).
88- Float64("kill", opts.WebProcessMemory.KillThreshold).
8988 Msg("created WebContext with memory pressure settings")
9089 }
9190 }
@@ -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
4141 Float64("poll_sec", cfg.PollIntervalSec).
4242 Float64("conservative", cfg.ConservativeThreshold).
4343 Float64("strict", cfg.StrictThreshold).
44- Float64("kill", cfg.KillThreshold).
4544 Msg("applied network process memory pressure settings")
4645
4746 return nil
@@ -72,7 +71,6 @@ func (*MemoryPressureApplier) ApplyWebProcessSettings(ctx context.Context, cfg *
7271 Float64("poll_sec", cfg.PollIntervalSec).
7372 Float64("conservative", cfg.ConservativeThreshold).
7473 Float64("strict", cfg.StrictThreshold).
75- Float64("kill", cfg.KillThreshold).
7674 Msg("prepared web process memory pressure settings")
7775
7876 return settings, nil
@@ -112,11 +110,6 @@ func buildMemoryPressureSettings(cfg *port.MemoryPressureConfig) *webkit.MemoryP
112110 }
113111 }
114112
115- // Kill threshold: -1 = unset, 0 = never kill, >0 = threshold
116- if cfg.KillThreshold >= 0 {
117- settings.SetKillThreshold(cfg.KillThreshold)
118- }
119-
120113 return settings
121114 }
122115
@@ -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 nil46 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, nil76 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 settings113 return settings
121 }114 }
122 115
M internal/infrastructure/webkit/scheme_handler.go +0 -2
@@ -114,7 +114,6 @@ type configResolvedPerformance struct {
114114 WebViewPoolPrewarm int `json:"webview_pool_prewarm"`
115115 ConservativeThreshold float64 `json:"conservative_threshold"`
116116 StrictThreshold float64 `json:"strict_threshold"`
117- KillThreshold float64 `json:"kill_threshold"`
118117 }
119118
120119 type configPayload struct {
@@ -224,7 +223,6 @@ func (h *DumbSchemeHandler) buildConfigResponse(cfg *config.Config) *SchemeRespo
224223 WebViewPoolPrewarm: resolved.WebViewPoolPrewarmCount,
225224 ConservativeThreshold: resolved.WebProcessMemoryConservativeThreshold,
226225 StrictThreshold: resolved.WebProcessMemoryStrictThreshold,
227- KillThreshold: resolved.WebProcessMemoryKillThreshold,
228226 },
229227 Hardware: buildHardwarePayload(hw),
230228 },
@@ -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 @@
3636 webview_pool_prewarm: number;
3737 conservative_threshold: number;
3838 strict_threshold: number;
39- kill_threshold: number;
4039 };
4140
4241 type HardwareInfo = {
@@ -596,13 +595,6 @@
596595 </div>
597596 <p class="text-xs text-muted-foreground">Pre-created WebViews at startup for faster new tab/pane creation.</p>
598597 </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>
606598 </div>
607599 </div>
608600 {/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}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close