v0.3.0 d226234

quickstart.md RawHistoryFolder

Quickstart: WebKit Memory Optimization

Feature: 005-webkit-memory-optimization Purpose: Validate that WebKit memory optimization reduces memory usage by 40-60% while maintaining browser functionality Estimated Time: 15 minutes

Prerequisites

  • dumb-browser built with webkit_cgo tags
  • WebKit2GTK 6.0+ installed
  • Linux system with /proc filesystem
  • At least 2GB available RAM for testing

Quick Validation Test

Step 1: Baseline Memory Measurement

# Start browser with default settings
./dumber --url=https://example.com

# In another terminal, measure baseline memory
ps aux | grep dumber | grep -v grep
# Note the RSS memory usage (column 6) - should be ~400MB

Step 2: Enable Memory Optimization

# Stop the browser and restart with memory optimization
./dumber --memory-limit=256 --cache-model=document_viewer --url=https://example.com

# Measure optimized memory usage
ps aux | grep dumber | grep -v grep
# Note the RSS memory usage - should be 150-250MB (40-60% reduction)

Step 3: Test Browser Functionality

Navigate to several websites to ensure functionality is preserved:

# Test different website types
https://example.com          # Simple static site
https://news.ycombinator.com # Content-heavy site
https://github.com          # Interactive web app

Expected: All sites should load correctly with no functionality loss

Step 4: Test Memory Monitoring

# Enable detailed memory monitoring
./dumber --memory-monitoring=true --url=https://example.com

# Check logs for memory events
tail -f ~/.config/dumber/logs/memory.log

Expected: Log entries showing memory usage, GC events, and optimization activities

Step 5: Test Memory Pressure Response

# Simulate high memory usage by opening many tabs or heavy websites
# Browser should automatically trigger cleanup when approaching limits

# Monitor memory stats via API endpoint (if implemented)
curl http://localhost:8080/api/memory/stats

Expected: Memory usage should stabilize, cleanup events should be logged

Integration Test Scenarios

Scenario 1: Memory-Optimized Configuration

Given browser started with memory-optimized preset When I navigate to a typical website Then memory usage should be ≤250MB

# Test memory-optimized preset
./dumber --preset=memory-optimized --url=https://example.com
ps aux | grep dumber | awk '{print $6}' # Should be ≤256MB

Scenario 2: Process Recycling

Given browser with recycling threshold set to 10 pages When I navigate to 15 different pages Then browser should recommend process recycling

# Test process recycling
./dumber --recycle-threshold=10 --memory-monitoring=true
# Navigate to 15 different URLs
# Check logs for recycling recommendation

Scenario 3: Memory Stability

Given browser with memory optimization enabled When I browse 50 different web pages Then memory usage should remain stable (no significant growth)

# Test memory stability over time
for i in {1..50}; do
  echo "Loading page $i"
  # Navigate to different pages
  sleep 2
  ps aux | grep dumber | awk '{print $6}' >> memory_usage.log
done
# Analyze memory_usage.log for growth trends

Acceptance Criteria Validation

✅ FR-001: Memory Usage Reduction

  • Baseline measurement: ~400MB
  • Optimized measurement: 150-250MB
  • Reduction percentage: 40-60%

✅ FR-002: Configurable Memory Limits

  • Memory limit configuration working
  • Different presets produce different memory usage
  • Custom thresholds respected

✅ FR-003: Optimization Presets

  • Memory-optimized preset: lowest memory usage
  • Balanced preset: moderate memory usage
  • Performance preset: highest memory usage

✅ FR-004: Automatic Memory Cleanup

  • Memory pressure triggers cleanup
  • Cleanup completes without crashing
  • Memory usage decreases after cleanup

✅ FR-005: Memory Statistics

  • Memory stats API accessible
  • Statistics updated regularly
  • Historical data tracked

✅ FR-006: Browser Stability

  • No crashes during optimization
  • All websites load correctly
  • Navigation remains smooth

✅ FR-007: Essential Functionality Preserved

  • Page navigation works
  • JavaScript execution works
  • Form submission works
  • Media playback works (if applicable)

✅ FR-008: Manual Memory Cleanup

  • Manual cleanup trigger available
  • Cleanup executes successfully
  • Memory usage decreases after manual trigger

✅ FR-009: Process Recycling

  • Page load counting accurate
  • Recycling recommendations logged
  • New process has reset counters

✅ FR-010: Memory Event Logging

  • Memory optimization events logged
  • Log format is structured and readable
  • Log verbosity controllable

Performance Validation

Memory Usage Benchmarks

# Run benchmark script to measure memory over time
./scripts/memory-benchmark.sh

Expected results:
- Startup memory: <100MB
- Single page memory: 150-250MB (optimized) vs 350-450MB (default)
- 10 page memory: <300MB (optimized) vs >500MB (default)
- Memory stability: <10% growth over 50 page loads

Performance Impact Assessment

# Measure page load times with/without optimization
./scripts/performance-benchmark.sh

Expected results:
- Page load time increase: <20%
- JavaScript performance impact: <15%
- Navigation responsiveness: maintained

Troubleshooting

Common Issues

Memory optimization not working:

  • Check WebKit2GTK version (requires 6.0+)
  • Verify webkit_cgo build tags enabled
  • Check configuration values in logs

Browser crashes with memory limits:

  • Increase memory limit (try 512MB)
  • Disable kill threshold (set to 0)
  • Check for website-specific memory requirements

Memory monitoring not working:

  • Verify /proc filesystem accessible
  • Check process permissions
  • Enable debug logging

Validation Commands

# Check WebKit version
pkg-config --modversion webkitgtk-6.0

# Verify build configuration
./dumber --version | grep webkit_cgo

# Test memory monitoring
./dumber --memory-monitoring=true --verbose

Success Criteria

  • Memory usage reduced by 40-60% compared to baseline
  • All browser functionality preserved
  • Memory monitoring and statistics working
  • Process recycling recommendations functional
  • No stability regressions
  • Configuration presets working correctly
  • Performance impact within acceptable limits (<20%)

Expected Completion Time: 15-30 minutes depending on thorough testing Pass Criteria: All acceptance criteria validated, no critical functionality broken

source
1# Quickstart: WebKit Memory Optimization
2
3**Feature**: 005-webkit-memory-optimization
4**Purpose**: Validate that WebKit memory optimization reduces memory usage by 40-60% while maintaining browser functionality
5**Estimated Time**: 15 minutes
6
7## Prerequisites
8- dumb-browser built with webkit_cgo tags
9- WebKit2GTK 6.0+ installed
10- Linux system with /proc filesystem
11- At least 2GB available RAM for testing
12
13## Quick Validation Test
14
15### Step 1: Baseline Memory Measurement
16```bash
17# Start browser with default settings
18./dumber --url=https://example.com
19
20# In another terminal, measure baseline memory
21ps aux | grep dumber | grep -v grep
22# Note the RSS memory usage (column 6) - should be ~400MB
23```
24
25### Step 2: Enable Memory Optimization
26```bash
27# Stop the browser and restart with memory optimization
28./dumber --memory-limit=256 --cache-model=document_viewer --url=https://example.com
29
30# Measure optimized memory usage
31ps aux | grep dumber | grep -v grep
32# Note the RSS memory usage - should be 150-250MB (40-60% reduction)
33```
34
35### Step 3: Test Browser Functionality
36Navigate to several websites to ensure functionality is preserved:
37```bash
38# Test different website types
39https://example.com          # Simple static site
40https://news.ycombinator.com # Content-heavy site
41https://github.com          # Interactive web app
42```
43
44**Expected**: All sites should load correctly with no functionality loss
45
46### Step 4: Test Memory Monitoring
47```bash
48# Enable detailed memory monitoring
49./dumber --memory-monitoring=true --url=https://example.com
50
51# Check logs for memory events
52tail -f ~/.config/dumber/logs/memory.log
53```
54
55**Expected**: Log entries showing memory usage, GC events, and optimization activities
56
57### Step 5: Test Memory Pressure Response
58```bash
59# Simulate high memory usage by opening many tabs or heavy websites
60# Browser should automatically trigger cleanup when approaching limits
61
62# Monitor memory stats via API endpoint (if implemented)
63curl http://localhost:8080/api/memory/stats
64```
65
66**Expected**: Memory usage should stabilize, cleanup events should be logged
67
68## Integration Test Scenarios
69
70### Scenario 1: Memory-Optimized Configuration
71**Given** browser started with memory-optimized preset
72**When** I navigate to a typical website
73**Then** memory usage should be ≤250MB
74
75```bash
76# Test memory-optimized preset
77./dumber --preset=memory-optimized --url=https://example.com
78ps aux | grep dumber | awk '{print $6}' # Should be ≤256MB
79```
80
81### Scenario 2: Process Recycling
82**Given** browser with recycling threshold set to 10 pages
83**When** I navigate to 15 different pages
84**Then** browser should recommend process recycling
85
86```bash
87# Test process recycling
88./dumber --recycle-threshold=10 --memory-monitoring=true
89# Navigate to 15 different URLs
90# Check logs for recycling recommendation
91```
92
93### Scenario 3: Memory Stability
94**Given** browser with memory optimization enabled
95**When** I browse 50 different web pages
96**Then** memory usage should remain stable (no significant growth)
97
98```bash
99# Test memory stability over time
100for i in {1..50}; do
101  echo "Loading page $i"
102  # Navigate to different pages
103  sleep 2
104  ps aux | grep dumber | awk '{print $6}' >> memory_usage.log
105done
106# Analyze memory_usage.log for growth trends
107```
108
109## Acceptance Criteria Validation
110
111### ✅ FR-001: Memory Usage Reduction
112- [ ] Baseline measurement: ~400MB
113- [ ] Optimized measurement: 150-250MB
114- [ ] Reduction percentage: 40-60%
115
116### ✅ FR-002: Configurable Memory Limits
117- [ ] Memory limit configuration working
118- [ ] Different presets produce different memory usage
119- [ ] Custom thresholds respected
120
121### ✅ FR-003: Optimization Presets
122- [ ] Memory-optimized preset: lowest memory usage
123- [ ] Balanced preset: moderate memory usage
124- [ ] Performance preset: highest memory usage
125
126### ✅ FR-004: Automatic Memory Cleanup
127- [ ] Memory pressure triggers cleanup
128- [ ] Cleanup completes without crashing
129- [ ] Memory usage decreases after cleanup
130
131### ✅ FR-005: Memory Statistics
132- [ ] Memory stats API accessible
133- [ ] Statistics updated regularly
134- [ ] Historical data tracked
135
136### ✅ FR-006: Browser Stability
137- [ ] No crashes during optimization
138- [ ] All websites load correctly
139- [ ] Navigation remains smooth
140
141### ✅ FR-007: Essential Functionality Preserved
142- [ ] Page navigation works
143- [ ] JavaScript execution works
144- [ ] Form submission works
145- [ ] Media playback works (if applicable)
146
147### ✅ FR-008: Manual Memory Cleanup
148- [ ] Manual cleanup trigger available
149- [ ] Cleanup executes successfully
150- [ ] Memory usage decreases after manual trigger
151
152### ✅ FR-009: Process Recycling
153- [ ] Page load counting accurate
154- [ ] Recycling recommendations logged
155- [ ] New process has reset counters
156
157### ✅ FR-010: Memory Event Logging
158- [ ] Memory optimization events logged
159- [ ] Log format is structured and readable
160- [ ] Log verbosity controllable
161
162## Performance Validation
163
164### Memory Usage Benchmarks
165```bash
166# Run benchmark script to measure memory over time
167./scripts/memory-benchmark.sh
168
169Expected results:
170- Startup memory: <100MB
171- Single page memory: 150-250MB (optimized) vs 350-450MB (default)
172- 10 page memory: <300MB (optimized) vs >500MB (default)
173- Memory stability: <10% growth over 50 page loads
174```
175
176### Performance Impact Assessment
177```bash
178# Measure page load times with/without optimization
179./scripts/performance-benchmark.sh
180
181Expected results:
182- Page load time increase: <20%
183- JavaScript performance impact: <15%
184- Navigation responsiveness: maintained
185```
186
187## Troubleshooting
188
189### Common Issues
190
191**Memory optimization not working**: 
192- Check WebKit2GTK version (requires 6.0+)
193- Verify webkit_cgo build tags enabled
194- Check configuration values in logs
195
196**Browser crashes with memory limits**:
197- Increase memory limit (try 512MB)
198- Disable kill threshold (set to 0)
199- Check for website-specific memory requirements
200
201**Memory monitoring not working**:
202- Verify /proc filesystem accessible
203- Check process permissions
204- Enable debug logging
205
206### Validation Commands
207```bash
208# Check WebKit version
209pkg-config --modversion webkitgtk-6.0
210
211# Verify build configuration
212./dumber --version | grep webkit_cgo
213
214# Test memory monitoring
215./dumber --memory-monitoring=true --verbose
216```
217
218## Success Criteria
219- [ ] Memory usage reduced by 40-60% compared to baseline
220- [ ] All browser functionality preserved
221- [ ] Memory monitoring and statistics working
222- [ ] Process recycling recommendations functional
223- [ ] No stability regressions
224- [ ] Configuration presets working correctly
225- [ ] Performance impact within acceptable limits (<20%)
226
227**Expected Completion Time**: 15-30 minutes depending on thorough testing
228**Pass Criteria**: All acceptance criteria validated, no critical functionality broken

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