DigUp Kills Its Own Indexer to Survive Your Worst PDF

A local-first search tool that reads your photos, PDFs, and podcasts by meaning, and treats every file parser as a hostile dependency.

9 min read • View on GitHub • More from ARahim3

A wide black ink editorial illustration showing a small macOS menubar silhouette at the top of the frame with a single taut thread running down to a smaller humanoid helper figure. The helper clutches an enormous ballooning PDF page that has swollen into a tangled mass of crosshatching, and a clean scissor-cut severs the thread just above the helper. It illustrates a supervisor process deliberately terminating a disposable worker before a runaway file can drag the whole system down.
The whole thesis in one frame: the app above, the disposable worker below, the runaway file, and the deliberate cut.
Key Takeaways

The PDF That Ate 30 Gigabytes

Apple's PDF text extraction can grow without end. On a page of certain PDFs it consumed 30 GB of RAM in 3.5 minutes and never returned. That number is not a stress test invented for a benchmark. It sits in a comment inside DigUp's own source, written by someone who watched it happen.

Nothing outside a running process can stop code like that. You cannot politely ask a parser to stop allocating. You cannot cancel a call that has already descended into a native library. You can only end the process that is doing it.

// Apple's PDF text extraction has grown without end on a page of some
// PDFs (30 GB in 3.5 minutes, never returning), and nothing stops code
// like that from outside but ending the process.
//
// Source: Sources/digup/Watchdog.swift, ARahim3/DigUp

That is the failure mode DigUp is built around. The app does not pretend its dependencies are well behaved. It assumes the opposite, and it designs the architecture so that a single bad file cannot take down the session.

The App That Kills Its Own Indexer

DigUp never runs extraction inside the app itself. When you point it at a folder, it spawns a helper process called index-service, and that helper does the reading: OCR through Vision, text through PDFKit, frames through AVFoundation. When it finishes, it exits, and every byte it borrowed returns to the operating system.

A watchdog sits beside it. Once per second it samples two things: the helper's memory footprint and how long the current file has been in progress. Cross either limit and the watchdog writes down the file path and the reason, then exits with a specific code.

memoryLimit = min(8 GB, max(4 GB, physicalRAM / 2))

// Scales with the machine, never below 4 GB, never above 8 GB.
// Exceed it, or blow the per-file time limit, and the helper exits
// with StoppedFile.exitCode.

The app sees that exit code, starts a fresh helper, and the new one reads the note from disk, marks the file as unreadable, and moves on. One runaway file costs one restart. It does not cost the session.

Two companion defenses live in the same loop. A timing rule called yieldAt guarantees that indexing gets at least as long as the sync that preceded it, so a folder that keeps changing cannot starve indexing forever. And a pre-sync availability check treats an absent folder as unknown rather than deleted, so an unplugged drive never crawls as if every file on it had vanished.

Anatomy of a Suicide

Step through the control loop: memory climbs, the limit trips, a note is written, the helper dies, and a fresh one keeps going.

Why It Had to Be This Way

ARahim3 built DigUp as a local-first tool. No account, no telemetry, and the only network traffic is a one-time 865 MB model download plus a daily update check that sends nothing about your files. The index, the vectors, and the queries all stay on the disk.

WSJ hedcut-style black ink portrait of ARahim3, the lead contributor to the DigUp project, rendered from their public GitHub avatar with stipple dots for skin texture and fine hatching for hair and clothing.

Process isolation is not only crash-proofing. It is also how DigUp keeps its own memory small. Vision alone keeps about 100 MB of models cached in whatever process ran OCR. In a measured run the app went from 16 MB to 93 MB after indexing 11 screenshots and stayed there. By moving extraction into a process that exits, DigUp hands all of that back to the OS instead of carrying it for the life of the app.

The same philosophy shapes the product boundary. DigUp is deliberately not a chatbot.

No. DigUp is a search: you describe what you remember and it finds the file and the place in it. No language model writes answers, and nothing is sent anywhere.

DigUp project, Project FAQ · FAQ – DigUp

One Vector Space for Four Senses

A close-up black ink editorial illustration of a workbench surface holding three objects side by side: a glossy photograph, a coiled sound waveform, and a block of printed text. A single pair of precision calipers is applied to each in turn, and the dial reads identically for all three. It illustrates how text, images, and audio are measured into one shared embedding space by the same model.
Different inputs, one measurement. Text, images, and audio pass through the same model and land in the same coordinate space.

Underneath the defensive engineering is the actual product. EmbeddingGemma 2, run through llama.cpp, maps text, images, audio, and video into one shared coordinate space. A search for the lease clause about parking can return a PDF page. A search for that podcast bit about sourdough can return a 30-second timestamp.

DigUp combines that semantic retrieval with exact-string matching in the same query, so a filename you half remember and a concept you half describe can both hit. Results do not stop at the file. They land at a location inside it.

A Small Engine, Many Shells

The architecture follows from one decision: keep the engine free of any UI. DigUpKit is the library that crawls, extracts, indexes, and searches. It has no window, no menu, and no opinion about your desktop.

Above it sit the shells. On macOS, DigUpApp is a SwiftUI menubar app. The digup CLI carries the same engine plus the process-level services that any shell can drive. Windows and Linux shells talk to those services over JSON lines, which is why they can be written in a different language entirely.

Even the naming is a constraint. The app bundle cannot be called DigUp, because on a case-insensitive disk it would collide with the digup CLI binary. Small details like that are what a portable engine forces you to notice.

How It Compares

DimensionDigUpSpotlight / Windows SearchRecoll / DocFetcherKhoj
Search basisMeaning plus exact termsNames, metadata, indexed textFull textMeaning, chatbot answers
ModalitiesText, image, audio, video, codeText, metadataTextText, some media
Result granularityPDF page, video timestamp, code lineFileFile or passageGenerated answer
ProcessingFully localLocalLocalServer or local
LicenseMITProprietaryOpen sourceOpen source

Positioning is drawn from each project's own documentation. DigUp's cross-platform parity across macOS, Windows, and Linux is described in the repo but not independently verified here. The project's own FAQ frames built-in search as complementary rather than obsolete, and that is the honest reading: DigUp adds content-level, cross-modal search on top of what the system already does well.