Concepts
Memory and Machine health
How Duscode keeps your computer from running out of memory, what Machine health shows, what Free memory does, and how it cleans up without ever losing a job.
Duscode runs tests, builds, dev servers and browsers on your computer. It looks after the memory they use, so your computer doesn't slow to a crawl, start swapping heavily or crash because of Duscode.
What Duscode does on its own
- Heavy work waits for memory. Before it starts tests, a build, Local CI, a dev server, a headless browser or extra helpers, Duscode checks free memory, swap, the temporary folder and how busy the processor is. If memory is short it waits, and the task says so in plain words: "Waiting for memory: only 1.4 GB free". It starts as soon as there is room. It never closes your own programs to make room.
- Queued work starts by itself when there is room. Requests waiting in a task's queue, engineering and fix jobs, and Board cards Dus builds start as soon as your computer has room, never more at once than your Tasks at once setting. While one waits, it says why: "Waiting for room on this computer: starts when memory frees up". You never need to nudge it.
- Big temporary files go on the disk. On some computers (often WSL),
/tmpis held in memory: whatever is written there uses RAM. Duscode notices this and puts large temporary files on the disk instead: test runs, build output and checkouts go to/var/tmpor Duscode's cache folder (~/.cache/duscode/tmp). Small files can stay in/tmp. - Its idle processes stop. Dev servers, previews and browsers that Dus started stop after 30 minutes without use. They start again the next time they're needed. A service you asked to keep running is never stopped this way. You can change the time, or turn this off, in Settings → General → Machine load.
- It cleans up only after itself, and only what is finished. Every temporary folder and worktree Duscode makes carries a note saying which Duscode process owns it and which job it belongs to. Duscode removes a folder only when that process has ended. How old a folder is doesn't count. It never removes:
- anything a running Duscode or a queued or running job still uses;
- a worktree with uncommitted or unpushed work;
- a folder without Duscode's note (from an older version, or not Duscode's);
- anything belonging to another program, another user or another computer.
Worktrees Dus makes for helpers are named dus-<job>-<id> and locked with git (git worktree lock) while their job runs. The lock says whose they are, so other tools leave them alone. Repo hygiene and the Agents board show the owner. A worktree you or another tool made is never touched without asking you.
Machine health
The Machine health card in the workspace's right-hand panel always shows one quiet line about memory: how much is free, how much swap is in use and how much /tmp holds in memory. The line turns amber when memory is getting short and red when it is nearly full. Open it to see:
- the biggest processes Dus started (a dev server, the preview, a browser), with the memory each uses and how long it has been unused;
- on WSL, the memory and swap limits WSL has, and a suggestion when different values would help.
Other problems (disk nearly full, file watches near the limit, the clock) appear on the same card when there are any. See When your machine gets in the way.
Free memory
Free memory on the memory line shows exactly what it will do before it does anything:
- which of Dus's idle processes it will stop (with the memory each uses);
- which temporary folders of runs that have already ended it will remove;
- what it leaves alone, and why.
Nothing happens until you confirm. It then does only what it showed, and checks each item again first. A process you used in the meantime, or a folder whose owner came back, is left alone.
WSL memory and swap
WSL has its own memory and swap limits, set in .wslconfig in your Windows user folder. Duscode reads them (it never changes them). When they don't suit the machine, it suggests values: swap of at least a quarter of memory, so a burst slows things down instead of a program being stopped, and a memory limit that leaves Windows room. You get the exact PowerShell command to run in Windows. The new values apply the next time WSL restarts. A restart stops every Linux program, so choose the moment yourself.
In a terminal, duscode doctor shows the same memory line and WSL suggestion.
Settings
In Settings → General → Machine load:
| Setting | Default | What it does |
|---|---|---|
| Keep this much memory free | 2 GB | Heavy work waits while less than this is free. |
| Wait above this swap use | 75 % | Heavy work waits while more swap than this is in use and memory is short. |
| Wait above this in-memory /tmp use | 80 % | When /tmp is held in memory, heavy work waits while it is fuller than this. |
| Stop Dus's idle dev servers and browsers after | 30 min | 0 never stops them. |
| Wait above this load per CPU, Heavy jobs at once, Test workers per job | How busy the processor may be, and how much runs at once. |