Closes#30. The memory figures you see change, so this needs your approval. The layout is the same.
The worker used os.freemem(), which leaves out the page cache, so a healthy Linux machine looks almost full. On the production worker (CT 153, 512 MB):
MemFree
MemAvailable
Shown today
Shown after
CT 153
4 MB
449 MB
~99% used
~12% used
(On this test machine the two figures happen to be close, 15.1% and 15.6%, so the screenshot mostly shows that the card is unchanged. The difference is large on CT 153.)
Worker: the heartbeat adds availableMem, read from MemAvailable in /proc/meminfo, with os.freemem() as the fallback. freeMem stays, so older servers keep working.
Workers tab and dashboard: used memory is computed from availableMem when it's present, and from freeMem for workers that don't report it yet.
Deploy: this changes the worker, so Deploy worker will update CT 153. Expect a brief reconnect; Gandalf retries.
Tests: unit tests cover the parsing and the fallback. Locally: worker 19/19, UI 34/34.
Closes #30. **The memory figures you see change, so this needs your approval.** The layout is the same.
The worker used `os.freemem()`, which leaves out the page cache, so a healthy Linux machine looks almost full. On the production worker (CT 153, 512 MB):
| | MemFree | MemAvailable | Shown today | Shown after |
|---|---|---|---|---|
| CT 153 | 4 MB | 449 MB | **~99% used** | **~12% used** |

(On this test machine the two figures happen to be close, 15.1% and 15.6%, so the screenshot mostly shows that the card is unchanged. The difference is large on CT 153.)
- **Worker:** the heartbeat adds `availableMem`, read from `MemAvailable` in `/proc/meminfo`, with `os.freemem()` as the fallback. `freeMem` stays, so older servers keep working.
- **Workers tab and dashboard:** used memory is computed from `availableMem` when it's present, and from `freeMem` for workers that don't report it yet.
- **Deploy:** this changes the worker, so `Deploy worker` will update CT 153. Expect a brief reconnect; Gandalf retries.
- **Tests:** unit tests cover the parsing and the fallback. Locally: worker 19/19, UI 34/34.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
os.freemem() leaves out the page cache, so a healthy Linux box looks full:
the production worker (CT 153, 512 MB) has 4 MB free but 449 MB
available, and showed as 99% used instead of about 12%.
- worker: heartbeat metadata adds availableMem from MemAvailable in
/proc/meminfo (falls back to os.freemem()); freeMem stays for old
servers.
- Workers tab and dashboard compute used memory from availableMem when
present, from freeMem for workers that predate it.
- Unit tests for the meminfo parsing and the fallback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jared
merged commit db1e2e7ec9 into main2026-11-23 12:09:37 -05:00
jared
deleted branch memory-available2026-11-23 12:09:40 -05:00
Correction to this PR's description. The before/after table was wrong. On Node 20, os.freemem() already returns MemAvailable: libuv changed uv_get_free_memory in 1.45, and production runs libuv 1.46. So the worker was already shown correctly, and after this deploy CT 153 shows 9.2% used under both the old and the new field.
I worked out the "99% used" figure from /proc/meminfo (MemFree) without checking what Node actually reports.
The change is still correct and harmless: it reads MemAvailable explicitly, so the number stays right on Node versions before libuv 1.45 (which is what #30 was written against). It just isn't the visible fix I described.
**Correction to this PR's description.** The before/after table was wrong. On Node 20, `os.freemem()` already returns `MemAvailable`: libuv changed `uv_get_free_memory` in 1.45, and production runs libuv 1.46. So the worker was already shown correctly, and after this deploy CT 153 shows 9.2% used under both the old and the new field.
I worked out the "99% used" figure from `/proc/meminfo` (MemFree) without checking what Node actually reports.
The change is still correct and harmless: it reads `MemAvailable` explicitly, so the number stays right on Node versions before libuv 1.45 (which is what #30 was written against). It just isn't the visible fix I described.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #30. The memory figures you see change, so this needs your approval. The layout is the same.
The worker used
os.freemem(), which leaves out the page cache, so a healthy Linux machine looks almost full. On the production worker (CT 153, 512 MB):(On this test machine the two figures happen to be close, 15.1% and 15.6%, so the screenshot mostly shows that the card is unchanged. The difference is large on CT 153.)
availableMem, read fromMemAvailablein/proc/meminfo, withos.freemem()as the fallback.freeMemstays, so older servers keep working.availableMemwhen it's present, and fromfreeMemfor workers that don't report it yet.Deploy workerwill update CT 153. Expect a brief reconnect; Gandalf retries.🤖 Generated with Claude Code
Correction to this PR's description. The before/after table was wrong. On Node 20,
os.freemem()already returnsMemAvailable: libuv changeduv_get_free_memoryin 1.45, and production runs libuv 1.46. So the worker was already shown correctly, and after this deploy CT 153 shows 9.2% used under both the old and the new field.I worked out the "99% used" figure from
/proc/meminfo(MemFree) without checking what Node actually reports.The change is still correct and harmless: it reads
MemAvailableexplicitly, so the number stays right on Node versions before libuv 1.45 (which is what #30 was written against). It just isn't the visible fix I described.