I’ve been wondering why my SSD’s write counter keeps climbing, and this week I finally sat down and traced it. The answer: Antigravity. On a normal working day, language_server.exe alone issues around 30 GiB of file write requests (kernel-level ETW tracing, Windows 11, Antigravity 2.19.1). It isn’t a spike — it’s steady churn, and nearly all of it lands in the per-conversation SQLite databases under ~/.gemini/antigravity/conversations/.
Instead of guessing, I took one 90 MB conversation database and walked its WAL frame by frame — validating salt, rolling checksums and commit boundaries (1,188/1,188 frames valid) — then mapped every committed page write back to the table or index that owns it, using only the public SQLite file format. No conversation content was read; this is pure page accounting.
Here’s where the bytes actually go:
Owner
Share of committed WAL bytes
What’s happening
gen_metadata
48.3%
574 frames across 198 hot pages — each rewritten ~2.9×. The row seems to be rewritten in full on every streaming generation event.
steps (table)
17.2%
Genuine content changes — fair enough.
idx_steps_status + idx_steps_step_type
27.5%
82–94% of these frames are byte-identical rewrites of the same page.
page-1 header / freelist
~7%
bookkeeping
The third row is the one that stings. SQLite only skips index maintenance when the indexed column is absent from an UPDATE’s SET list. The writer appears to SET every column on every step save, so both indexes are rewritten each time — even though status and step_type rarely change. Across a long conversation that compounds into gigabytes of pure waste.
What I’d love to see:
Coalesce gen_metadata writes during streaming — persist on step completion (or on a short timer) instead of per chunk.
SET only columns that actually changed when saving steps, so unchanged indexed values stop triggering index-page rewrites.
Bound the WAL with periodic checkpointing so long sessions don’t accumulate unbounded sidecar files.
I hit all of this just by using the product normally — long agentic conversations on Windows. Happy to share the read-only measurement scripts if that’s useful to the team.
This is a masterclass in forensic accounting, Yon. Pinpointing the exact page distribution across a 1,188-frame WAL walk moves this from a vague suspicion of SSD thrashing to undeniable empirical telemetry.
We audited our own engineering workstation after reading your breakdown, and our figures fully corroborate your findings.
Workstation Corroboration & Schema Inspection
Across our active Antigravity installation on Windows 11:
We currently have 86 conversation databases under ~/.gemini/antigravity/conversations/ totalling 2.01 GB of persistent storage, with individual marathon sessions scaling up to 93 MB.
During active turns, the .db-wal sidecar file for the active session oscillates continuously between 12 MB and 32 MB as token generation streams in.
Inspecting the DDL on the local conversation databases confirms the structural mechanism you identified:
CREATE TABLE `gen_metadata` (`idx` integer, `data` blob, `size` integer NOT NULL DEFAULT 0, PRIMARY KEY (`idx`));
CREATE TABLE `steps` (`idx` integer, `step_type` integer NOT NULL DEFAULT 0, `status` integer NOT NULL DEFAULT 0, `step_payload` blob, PRIMARY KEY (`idx`));
CREATE INDEX `idx_steps_status` ON `steps`(`status`);
CREATE INDEX `idx_steps_step_type` ON `steps`(`step_type`);
Why the 75.8% Waste Occurs
Streaming BLOB Churn (gen_metadata - 48.3% of writes):
Because streaming LLM responses deliver incremental token chunks, executing full-row BLOB updates on every incoming chunk turns a single 2,000-word response into hundreds of discrete WAL writes for the exact same record.
Monolithic UPDATEs vs SQLite Index Engine (idx_steps_* - 27.5% of writes):
In SQLite, if an indexed column (status, step_type) appears in the SET clause of an UPDATE statement, the storage engine marks the index B-tree pages dirty for re-serialisation regardless of whether the underlying integer values actually changed. The language server ORM appears to emit a blanket UPDATE steps SET status=?, step_type=?, step_payload=? on every step payload increment, producing the 82-94% byte-identical leaf page rewrites you captured.
What We Implemented Locally (Mitigations & Tooling)
While awaiting core updates from the team, we incorporated three mitigations into our local developer environment and open-source MCP toolchain (part of our session-guard and workbench-guard RFCs) to stop NVMe write amplification:
NTFS Directory Junction (Zero SSD Flash Wear):
Because Antigravity accesses conversation databases via standard filesystem paths, you can redirect the entire conversation store to a secondary volume or RAM disk:
:: 1. Close Antigravity
:: 2. Move existing databases to a secondary volume (e.g. D:\AntigravityStorage or RAM disk R:\)
robocopy "%USERPROFILE%\.gemini\antigravity\conversations" "D:\AntigravityStorage" /E /MOVE
:: 3. Establish an NTFS directory junction
mklink /J "%USERPROFILE%\.gemini\antigravity\conversations" "D:\AntigravityStorage"
This immediately removes the ~30 GiB/day write burden from the primary OS NVMe drive.
Asynchronous Post-Migration WAL Compaction:
During active sessions, language_server.exe holds exclusive shared-memory handles (.db-shm), causing external PRAGMA wal_checkpoint(TRUNCATE) calls to fail with SQLITE_IOERR (778). However, when rotating or retiring a session (upon context handoff), we trigger an asynchronous background truncate once the active server unbinds. This instantly collapses bloated 30 MB WAL sidecars down to 0 bytes across retired sessions.
Cold Storage 7-Zip Compaction:
We added an automated pass that scans for inactive conversation databases older than 30 days, verifies archive integrity via 7z t, compresses them into a single LZMA2 archive (-mx=9), and unlinks the raw files. This reclaimed 565 MB across 22 stale sessions on our machine (~72% compression ratio) while retaining surgical, sub-second single-file extraction if an old conversation needs inspection.
Fully Endorsing Your Recommendations to the Core Team
Your proposed fixes are standard database engineering hygiene:
Coalesce in Memory: Buffer gen_metadata during token generation and flush to disk once per step or turn boundary.
Selective UPDATE Payloads: Exclude unchanged status/type integers from the update payload so SQLite skips index maintenance entirely.
Passive Background Checkpoints: Enforce PRAGMA wal_autocheckpoint = 1000; or trigger non-blocking PRAGMA wal_checkpoint(PASSIVE); during agent think-time so WAL files do not balloon during long sessions.
Did you notice whether the ETW write volume scales strictly with token streaming chunks, or does language_server.exe also flush intermediate AST and tool payload states into SQLite during multi-step tool execution?
I have not establisheda one-to-one relationship between token chunks and ETW write volume. TheWAL contains both gen_metadata and steps writes, but I have not yetcorrelated individual commits with AST updates or tool-execution phases.
After removing the two secondary steps indexes locally, a later528-frame sample attributed about 84.5% of frames to gen_metadata.Repeated pages in that group had changed contents. The latest metadataBLOBs in two sessions measured 705,588 and 492,666 bytes. This supportsinvestigating repeated large-BLOB updates, but does not establish thatthose updates are semantically redundant.
I would therefore avoid calling the combined 75.8% “waste.” Tableattribution and dispensable writes are different claims. Also, theapproximately 30 GiB figure is ETW file-write requests, not measuredphysical SSD writes. My conversation store is already junctioned to E:,a mechanical HDD; relocation changes where writes land rather thaneliminating them.
My requirement is to preserve intermediate recovery points. Flushingonly at step or turn boundaries would delay durability, so I cannotaccept that trade-off. I also stopped external live TRUNCATEinterventions after encountering lock contention. Checkpointing controlsWAL size; it does not remove the writes already generated, andwal_autocheckpoint must be configured on the actual writer connections.
The writer-side change I would like to see is selective updates and lessfull-BLOB rewriting while retaining the existing commit and recoveryguarantees.
By the way,Thanks for the suggestions. Here is the current status from my machine,which may help narrow the investigation.
The conversation store is already junctioned to a persistent E: HDD.After removing the two secondary steps indexes locally, a subsequent528-frame WAL sample attributed about 84.5% of frames to gen_metadata;repeated pages in that group had changed contents. The latest metadataBLOBs in two sessions measured 705,588 and 492,666 bytes. These areseparate observation windows, not a controlled before-and-afterbenchmark.
Progress-output suppression and TEMP/TMP redirection are now confirmedin the running Hub and language server, but their effect on business WALand physical writes has not yet been measured. The installation also haslocal logging/authentication patches and the index changes mentionedabove, so these observations are not a clean-stock reproduction.
Could the team check:
· The SQL emitted for steps updates, particularly whether unchangedstatus and step_type fields are included.
· The serialization and update path for gen_metadata, including how muchof a large BLOB changes per update and whether unchanged portions canavoid being rewritten while preserving existing recovery points.
· Which persistence updates occur during token streaming, tool
execution, and agent think-time. I have not yet established asynchronized token-to-commit correlation or specifically attributedwrites to AST updates.
I need to preserve intermediate crash-recovery points, so bufferinguntil step or turn completion would not meet that requirement. I stoppedexternal live TRUNCATE attempts after encountering lock contention.Checkpoint tuning may control WAL size, but it does not remove writesalready generated; it would also need to be applied to the actual writerconnections.
I upgraded to Antigravity v2.21.1 (language_server reports 2.21.1). The issue still persists.
Important clarification: the earlier ~30 GiB figure was file-I/O request bytes, not necessarily physical disk writes. After the upgrade I measured physical file growth
during startup/new conversation creation on Windows 11:
- Window: about 181 seconds right after launch.
- A new conversation DB WAL grew from 32 bytes to 32,857,584 bytes (~31.3 MiB): conversations/169901c8-e373-40a9-a900-1592e82b6d25.db-wal
- The matching .db grew by 1,802,240 bytes.
- Logs grew by only 322 bytes in the same window.
- After startup, a later 10-minute normal-use window was quiet: language_server wrote only ~4.35 MB total and conversations/logs net size did not grow.
So the remaining problem is not logging; it is the conversation SQLite/WAL persistence burst when a conversation is created or updated. My profile is relocated to another volume, but the same WAL behavior would occur under the default profile path.
Could you please check the write pattern around gen_metadata/steps persistence, WAL autocheckpoint/page_size, and whether thinking text or embeddings are being persisted incrementally? I am not asking to delay committed saves or weaken crash recovery; losing intermediate recovery points is not acceptable. A supported knob to reduce non-recovery-critical metadata flush frequency would be ideal.
Maybe we can adapt the updater to Junction/Symlink, supplement SQLite with standard WAL Checkpoint idle recycling and micro batching, and use incremental Event Sourcing for persistence?
Two things to watch out for before you spend hours benchmarking:
First, PRAGMA page_size is only evaluated when creating a brand new database. For any existing session (*.db), SQLite locks the page size into bytes 16–17 of the file header at creation time and silently ignores the pragma when opening the file. Unless you run VACUUM; on the existing databases, your patched binary will still run them at 32 KiB.
Second, the 700 KiB gen_metadata BLOB math might actually bite you at 4 KiB.
At 32 KiB pages, a 705 KiB BLOB spills across ~22 overflow pages. At 4 KiB, that exact same BLOB is chopped into ~173 overflow pages. The total bytes written to disk are almost identical (~700 KiB either way), but at 4 KiB you are writing nearly 8x more individual WAL frames on every turn. That can trigger wal_autocheckpoint (default 1,000 frames) every 5 or 6 turns and spike .db-shm lock contention.
Where 4 KiB will help is small record appends in steps (writing 4 KiB instead of a wasteful 32 KiB frame).
The real villain remains what you pointed out in Post #7: Google dumping the entire monolithic 700 KiB session snapshot on every step instead of writing incremental deltas.
Definitely curious to see what your ETW traces show once you run the patched binary on a fresh DB.
Thanks a lot for the heads-up @dllhell, really appreciate the sharp insights!
You are 100% right on Point 1: PRAGMA page_size only takes effect on newly created databases. We observed this exact behavior early in our profiling—running on an existing 32 KiB session database silently ignored the pragma. Instead of running a risky VACUUM on existing sessions (which incurs an immediate write spike and locking hazard), we verified the patch on clean, newly spawned sessions (bceb787d...). The header bytes 0x10-0x11 confirmed 0x1000 (4096), while older sessions stayed at 0x8000.
Regarding Point 2 (the 700 KiB BLOB and overflow pages vs. WAL checkpoints): Here are the empirical numbers from our live ETW and psutil captures on the 4 KiB session:
Overall write rate drop: The sustained write rate dropped from ~0.56 MB/s down to 0.22 – 0.29 MB/s (a ~50% to 60% net reduction).
WAL frame savings: For a test window of 1,347 frames, the 4 KiB DB generated 5.55 MB of WAL writes, whereas the exact same frame count on a 32 KiB DB was costing 44.18 MB (an ~8x reduction in small step write amplification).
Checkpoint behavior: 1,000 frames at 4 KiB flushes 4 MB at a time. On modern NVMe drives, frequent 4 MB flushes turned out to be much smoother than bursting 32 MB chunks, and we observed zero .db-shm lock contention or UI hiccups in real-world usage.
Bonus finding — An even bigger culprit than SQLite: While profiling the remaining writes, we identified another massive contributor: ~/.gemini/antigravity/agyhub_summaries_proto.pb (~470 KB). Google is currently migrating from this legacy protobuf file to SQLite conversation_summaries.db. However, in jetbox_summaries_store.(*Store).Start.func1, they left a hardcoded 1.0s time.NewTicker (0x3b9aca00) that triggers (*Store).flushBatch → persist → fs.Path.AtomicWrite! Whenever a session updates, it was doing a whole-file atomic rewrite of all 470 KB every few seconds, accounting for >55% of all non-WAL writes.
We just patched that ticker instruction (VA 0x1422c9fef) from 1.0s (0x3b9aca00) to 4.0s (0xee6b2800)—just a 3-byte surgical change. Combined with the 4 KiB page size, the live language server write rate is now down to 0.155 – 0.22 MB/s (a total ~70% drop from the original 0.56 MB/s baseline), and the 470 KB whole-file rewrites dropped by 75%!
Happy to share the ETW traces and patch details if you’d like to check them out!
Thanks a lot for the thoughtful heads-up and theoretical analysis! You asked what the ETW traces would look like on a fresh database with the 4 KiB patch, and we just completed extensive profiling (using ETW per-file attribution, psutil, and SQLite SHM frame tracking).
Here are the empirical findings and our current solution:
1. Real Data Distribution: Why 4 KiB Actually Won Big
Your concern about the 1000-frame autocheckpoint lock contention was very insightful, but it assumed large BLOB writes (e.g., 700 KiB per step). We analyzed active production conversation databases (*.db) and found:
gen_metadata.data: Average row size is only ~6.2 KiB (a few max out at ~900 KiB, but >95% are small).
steps.step_payload: Average row size is ~9.0 KiB.
Autocheckpoint Frequency: In reality, it takes 400–500 steps to reach the 1,000-frame threshold, not 5–6 steps. There is zero observable checkpoint lock contention or SHM lock thrashing.
Write Amplification Slashed: Under the default page_size = 32768, appending a 6 KiB payload forces SQLite WAL to commit a full 32 KiB frame (a ~500% write amplification). Under page_size = 4096, it commits only 8 KiB (2 pages).
Result: The 4 KiB patch alone dropped total language_server disk write rate from ~0.56 MB/s down to ~0.22–0.29 MB/s on active sessions.
2. The Hidden Elephant: agyhub_summaries_proto.pb Dual-Write
While dissecting the remaining writes via ETW, we discovered that SQLite WAL was only half the story.
Every 7–15 seconds, another file was repeatedly eating substantial I/O:
Mechanism: In google3/third_party/jetski/language_server/jetbox_summaries_store, a 1.0s time.Ticker in Start.func1 regularly triggers (*Store).flushBatch.
Whenever sessions update, flushBatch does a hardcoded dual-write: it synchronizes into SQLite conversation_summaries.db, AND calls (*Store).persist which performs a full atomic rewrite (fs.Path.AtomicWrite) of the entire 470 KiB protobuf file!
3. Our Complete Solution (Two Schemes)
In addition to patching PRAGMA page_size = 32768 → PRAGMA page_size = 4096 (4 bytes) for fresh DBs, we tackled the protobuf dual-write:
Scheme A: Relax the Flush Ticker (3-byte patch, conservative)
In Start.func1 (VA 0x1422c9fef), change mov eax, 0x3b9aca00 (1.0s duration) to mov eax, 0xee6b2800 (4.0s).
Effect: Slashes pb rewrite frequency by ~75% (from every ~3s down to ~15s).
Result: Combined with 4 KiB pages, measured language_server write throughput dropped to 0.155 MB/s (a ~72% cumulative reduction from the 0.56 MB/s baseline).
Scheme B: Sever the Protobuf Dual-Write Completely (5-byte patch, zero-loss)
Since the upstream architecture is actively transitioning to SQLite conversation_summaries.db, the .pb file is redundant legacy persistence.
Reverse-engineering confirmed there is exactly one caller to (*Store).persist in the entire binary: inside flushBatch at VA 0x1422c73c0 (call persist, e8 9b 04 00 00).
The subsequent code checks test rcx, rcx; jne error_branch; je sqlite_sync.
Patch: We replaced the 5-byte call persist with 31 c9 90 90 90 (xor ecx, ecx; nop; nop; nop).
Effect: It sets rcx = 0, completely bypasses writing the 470 KiB protobuf file, and falls cleanly through into the normal SQLite sync logic. Zero stack drift, zero GC pointer corruption, and agyhub_summaries_proto.pb writes drop to 0 writes / 0 KB!
Hope these numbers and reverse-engineering details help you and others tracking down Antigravity’s disk write footprints!
Brilliant work, @yon_r. The ~500% write amplification on 6.2 KiB payloads (gen_metadata) across 32 KiB pages is the exact mathematical smoking gun explaining where the gigabytes were vanishing.
Isolating the unthrottled 1.0s ticker in jetbox_summaries_store is an equally critical catch. Even without binary patching, knowing that the legacy protobuf dual-write accounts for over half the non-WAL disk churn explains why users on fast NVMe drives were seeing relentless write amplification.
Between the 4 KiB page alignment data and identifying the summaries flush interval, this thread provides exceptionally clean diagnostic telemetry for the Antigravity engineering team (@Ambati_Rajendra) to investigate for upcoming releases. Superb forensic work.
To clarify expectations, @yon_r: as independent community researchers, we do not distribute binary patches or modified executables for language_server.exe. Official binary updates and upstream architectural fixes belong solely to the Google Antigravity engineering team (@Ambati_Rajendra).
The hex modification demonstrating the 4 KiB page size was an elegant diagnostic proof-of-concept that isolated the exact mathematical mechanism behind write amplification. However, running patched binaries on developer workstations carries real operational hazards: it invalidates binary code-signing signatures, trips endpoint security heuristics, and will be silently overwritten by the updater on the next release.
For engineers seeking immediate write reduction on their workstations without waiting for an upstream build or modifying binaries, two safe user-space mitigations operate cleanly today:
Directory Junction to Scratch / RAM Storage:
Junctioning the conversation directory (~/.gemini/antigravity/conversations) to a secondary mechanical drive or an in-memory RAM disk absorbs all transaction log churn while preserving the host SSD.
Non-Destructive Page Shrinkage via Vacuum:
Existing conversation databases can be compacted to 4 KiB pages using standard SQLite primitives without binary modifications:
PRAGMA page_size = 4096;
VACUUM;
The telemetry you isolated in this thread provides the upstream team with deterministic call sites and allocation ratios. That is the ideal outcome of community systems archaeology.
Environment: Antigravity 2.21.1, Windows 11 Pro build 26300 (x64)
Summary
During normal agent operation, Antigravity posts a new Windows toast notification
every 30–90 seconds. Each toast is persisted by the Windows Push Notification User
Service (WpnUserService) into wpndatabase.db (SQLite, WAL mode). Measured write
amplification is extreme: a ~140-byte toast payload produces ~3 MiB of physical disk
writes to wpndatabase.db-wal. At the observed posting rate this accounts for ~308
MiB/hour ≈ 7.4 GiB/day of continuous SSD writes — 17.6% of all physical writes to the
system drive on an otherwise idle machine.
Evidence (1-hour kernel ETW FileIO capture, 0 lost events, 99.9% closure against
device counters):
WpnUserService process wrote 309.2 MiB in one hour; wpndatabase.db-wal alone: 293.8
MiB
Windows notification store: 119 persisted notifications in the window, 99 (83%)
from electron.app.Antigravity, intervals 30–90 s
After setting HKCU...\Notifications\Settings\electron.app.Antigravity\Enabled = 0:
zero new entries for 100+ minutes (confirmed the causal path)
Impact
Continuous background SSD wear on the OS drive even when the machine is idle
WAL churn also triggers VSS copy-on-write amplification on systems with restore
points
Likely affects all Windows users of Antigravity; any Electron app posting frequent
toasts hits the same amplification
Request
Please avoid posting a brand-new toast for routine agent progress. Preferred fixes,
any of:
Update/replace the existing toast via ToastNotification.Tag instead of creating a
new one
Throttle/coalesce progress notifications (e.g., max 1 per few minutes, or only on
completion/error)
Respect Windows Focus Assist / notification settings before posting
Workaround (for other users hitting this): Windows Settings → Notifications →
Antigravity → Off. Note the app still plays its own completion sound, which is
unaffected by this setting.
Happy to provide the raw ETW capture summary or repro measurements if useful.
Adding a data point from the desktop app (2.26.0, Windows 11), measured on 25 October, since this thread was last checked on 2.21.1.
The summary store pattern is still there on the desktop side. ~\.gemini\antigravity\agyhub_summaries_proto.pb (759 KB) was replaced as a whole 6 times in 90 seconds while an agent ran, for a net change of minus 6 bytes. That is about 4.5 MB written per 90 seconds, roughly 180 MB an hour of agent work, to record a few bytes. It looks like the same thing @yon_r found in jetbox_summaries_store for the CLI.
The open conversation’s WAL stayed at 33 MB for the whole run, close to the 31.3 MiB yon_r measured after startup.
WAL files also get left behind. My conversations folder has 372 -wal files (210 MB) for 500 databases. Several are about 14 times the size of their database (31.8 MB of WAL for a 2.2 MB database), and a group of them dates from just after midnight on 15 October, when the language server crashed and restarted. They look like sessions that never got a final checkpoint.