Workflow · workflow
Memory-efficient image passing in Dropbox's iOS document scanner
The iOS document scanner pipeline caused large memory spikes by requiring a pixel copy at each processing stage via UIImage, leading to out-of-memory process terminations on device.
How it works
Common implementation structure
How this type of workflow is generally built, generalized across documented cases — not tied to any one vendor's stack. Click any stage to read what happens there. Specific products that implement these stages appear in “Tools commonly seen” below.
Stage 1 · Camera image capture
The iOS camera provides the input image, internally backed by a JPEG encoding.
Tools used
UIImageDBPixelBufferlibjpeg
Outcome
Replacing UIImage with a custom DBPixelBuffer class reduced memory spikes from 60MB to 40MB and cut peak memory usage by more than 50MB, improving scanner stability.
What failed first
Apple's UIImage container was unsuitable for a multi-stage image processing pipeline because it forced a pixel copy at each stage, generating excessive memory overhead and contributing to out-of-memory crashes.
Results
Volumefrom 60MB to 40MB
Grounding & classification
Source type: technical build writeup
14 fields verified against source quotes.
computer visiondocument aifailure mode describedmetric backednamed customerproduction runtime claimedtools describedworkflow describedsoftwaretechnical build writeup