<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Micah Stubbs's Weblog: beads</title><link href="https://micahstubbs.ai/" rel="alternate"/><link href="https://micahstubbs.ai/tags/beads.atom" rel="self"/><id>https://micahstubbs.ai/</id><updated>2026-01-24T10:16:49+00:00</updated><author><name>Micah Stubbs</name></author><entry><title>Systematic Debugging the Overnight OOM</title><link href="https://simonwillison.net/2026/Jan/24/oom-debugging-systematic-approach/#atom-tag" rel="alternate"/><published>2026-01-24T10:16:49+00:00</published><updated>2026-01-24T10:16:49+00:00</updated><id>https://simonwillison.net/2026/Jan/24/oom-debugging-systematic-approach/#atom-tag</id><summary type="html">
    #### Tracking down the OOM event
I woke up this morning to find my GNOME session had crashed overnight. Terminal sessions gone, browsers closed, had to log back in. The `journalctl` output told me why: an Out of Memory event that killed 48 processes at `00:56:33`.
My gut reaction was to blame Chrome or some runaway Node process, but this time I decided to actually look into it.
#### Systematic debugging with Claude
I asked [Claude](https://code.claude.com/docs/en/overview) to investigate using my `sd` short alias for [Jesse Vincent](https://metasocial.com/@jesse)'s excellent `systematic-debugging` [skill](https://github.com/obra/superpowers/blob/main/skills/systematic-debugging/SKILL.md), a four-phase debugging framework that goes:

1. Root Cause Investigation

2. Pattern Analysis

3. Hypothesis Testing

4. Implementation

That order matters. No guessing allowed.
```
please scan all claude code transcripts and the relevant system logs and develop three hypothesis, using the sd skill, as to what caused the OOM in the last ~6 hours or so
```
#### What got killed
Here's what `journalctl` showed:

14 orphaned `bd` processes stood out.
`bd` is the golang implementation of [beads](https://github.com/yegge/beads), a git-backed issue tracker I use with Claude Code. It spawns processes for triage, graph computations, and IPC. When Claude subagents invoke it, apparently these child processes weren't getting cleaned up.
The system had been running for 13+ days. 14 zombie beads processes built up over that time.

| Process | Count |
|---------|-------|
| `bd` | 14 |
| `zsh` | 11 |
| `http-server` | 5 |
| `python` | 4 |
| `claude` | 2 |
| `zoom` | 1 |

#### Three hypotheses

**Beads process accumulation** Each `bd` process holds memory for issue caching, graph operations (PageRank, betweenness), and IPC channels. 14 orphans over 13 days of uptime. Most likely cause.

**Claude transcript growth** Found transcript files at 491MB and 348MB. One session had 64 subagent files. Long-running sessions with large contexts might not free memory properly.

**http-server leaks** 5 orphaned `http-server` processes. Claude spawns these for HTML previews. When sessions crash, they persist.
#### The pattern underneath
All three point to the same thing: process lifecycle management failure.
When a parent process exits, children should get `SIGHUP` and terminate. But if they're detached or `nohup`'d, they become orphans with `PPID=1`. Without explicit cleanup, they stick around. Memory builds up. Eventually the OOM killer steps in.
The system has 62GB RAM and 80GB swap. Usage was at 42GB, not dangerous by itself. But multiple processes trying to allocate at once can still trigger the OOM killer.
#### Switching to beads_rust
The investigation led to a related change: migrating from `bd` to `br` ([beads_rust](https://github.com/Dicklesworthstone/beads_rust)) from [@doodlestein](https://x.com/doodlestein).
```
please replace bd with br ... in ~/.claude, all CLAUDE.mds, all claude skills, and everywhere else that `bd` is mentioned
```
The differences in `br`:

- Never auto-commits to git
- No background daemon processes
- You run `br sync --flush-only` explicitly when you want to sync

The golang `bd` had automatic background syncing and daemons. The Rust version makes everything explicit. Nothing runs unless you tell it to.

- `beads_rust`: You want a stable, minimal issue tracker that stays out of your way.
- `beads`: You want advanced features like Linear/Jira sync, RPC daemon, and automatic hooks.

Here's a [full comparison](https://github.com/Dicklesworthstone/beads_rust?tab=readme-ov-file#br-vs-original-beads-go):

| | `br` | `beads` |
|--------|------|---------|
| Language | Rust | Go |
| Lines of code | ~20,000 | ~276,000 |
| Git operations | Never (explicit) | Auto-commit, hooks |
| Storage | [SQLite](https://sqlite.org/) + [JSONL](https://jsonlines.org/) | [SQLite](https://sqlite.org/)/[Dolt](https://github.com/dolthub/dolt) |
| Background daemon | No | Yes |
| Hook installation | Manual | Automatic |
| Binary size | ~5-8 MB | ~30+ MB |
| Complexity | Focused | Feature-rich |

#### What I took away
The systematic debugging skill stopped me from doing what I normally would have done: blame Chrome, kill some processes, call it a day. Instead I got actual evidence pointing to 14 zombie beads processes that had built up over two weeks.
The fix wasn't just killing processes. It was figuring out why they accumulated and switching to a tool that handles process lifecycle better.
Full investigation notes: [oom-investigation-2026-01-24.md](https://gist.github.com/micahstubbs/2c885a9eb7596aaa051d809cbd1fcc21)


    
        &lt;p&gt;Tags: &lt;a href="https://micahstubbs.net/tags/claude-code"&gt;claude-code&lt;/a&gt;, &lt;a href="https://micahstubbs.net/tags/debugging"&gt;debugging&lt;/a&gt;, &lt;a href="https://micahstubbs.net/tags/oom"&gt;oom&lt;/a&gt;, &lt;a href="https://micahstubbs.net/tags/systematic-debugging"&gt;systematic-debugging&lt;/a&gt;, &lt;a href="https://micahstubbs.net/tags/linux"&gt;linux&lt;/a&gt;, &lt;a href="https://micahstubbs.net/tags/superpowers"&gt;superpowers&lt;/a&gt;, &lt;a href="https://micahstubbs.net/tags/beads"&gt;beads&lt;/a&gt;, &lt;a href="https://micahstubbs.net/tags/skills"&gt;skills&lt;/a&gt;, &lt;a href="https://micahstubbs.net/tags/rust"&gt;rust&lt;/a&gt;, &lt;a href="https://micahstubbs.net/tags/prompts"&gt;prompts&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="claude-code"/><category term="debugging"/><category term="oom"/><category term="systematic-debugging"/><category term="linux"/><category term="superpowers"/><category term="beads"/><category term="skills"/><category term="rust"/><category term="prompts"/></entry></feed>