mcap/modules
Musa Mahmood 8c8b2c6e38 [0.1.24] GPU memory: OCR runs largest first, gives its arenas' blocks back after each stage, and keeps its worker threads
OCR filled the GPU: 9 GB for the mobile model on gpu-bench's 30 images, past
16 GB for the server model, which Windows then paged into shared memory (1.5 to
11 s a capture). onnxruntime's logged arena extensions showed why: the arena
keeps every block it takes from CUDA and never joins or frees them, and OCR's
inputs grow from run to run (recognizer batches went narrowest first; images in
any order across calls), so each larger run left another block behind: 5.7 GB
of recognizer blocks where the widest batch needs 0.9 GB.

- Detection runs the largest images first, recognition the widest batches.
- The detector's and recognizer's arenas shrink once each stage of an
  ocr_process call is done, by a run on a small input with
  memory.enable_memory_arena_shrinkage. Shrinking after every run cost 33 to
  59% of the speed.
- The worker threads are made with the engine and kept, not made for every
  stage of every call (onnxruntime keeps GPU state for each thread that runs a
  session, microsoft/onnxruntime#33037); 6% faster.
- OCR's arenas grow by what is asked (kSameAsRequested).
- ort.log_level sets what the engines' onnxruntime environments log; INFO shows
  every arena extension.

Mobile OCR on gpu-bench (RTX 5080 laptop, 4 workers): peak 5.7 GB over the
baseline, 2 GB between calls, 142 ms a capture, against 9.0 GB and 126 ms. The
text read differs by a line in 2,986 (batches are grouped differently). The
server model is not yet measured again.
2026-10-17 21:12:57 -04:00
..
Basic [0.0.0] Capture viewer: a grid of every .mcap's preview, and one capture at full size in a window of its own 2026-10-07 11:41:38 +01:00
Capture_File [0.1.8] Video capture phase 5: sound, from the computer and the microphone, in sync 2026-10-10 08:08:47 +01:00
Capture_Text [0.0.0] .mcap version 2: OCR stored in each capture, search, a library scan, sorting by date; turned text 2026-10-07 21:51:18 +01:00
Default_Allocator [0.1.15] Startup: a catalog cache, the catalog on the background threads, rpmalloc, and [startup] timings 2026-10-13 07:26:42 +01:00
ffmpeg [0.0.9] Import: videos and animated GIFs, in .mcap version 4 2026-10-09 23:10:55 +01:00
File_Watcher [0.1.14] The library is watched: files added or deleted outside the app come and go on their own 2026-10-13 06:36:03 +01:00
Image_Decode [0.0.9] Import: videos and animated GIFs, in .mcap version 4 2026-10-09 23:10:55 +01:00
imgui-dx11-win32 [0.0.0] Capture viewer: a grid of every .mcap's preview, and one capture at full size in a window of its own 2026-10-07 11:41:38 +01:00
imgui-sdl [0.0.0] Capture viewer: a grid of every .mcap's preview, and one capture at full size in a window of its own 2026-10-07 11:41:38 +01:00
imgui-source [0.0.0] Capture viewer: a grid of every .mcap's preview, and one capture at full size in a window of its own 2026-10-07 11:41:38 +01:00
jaison [0.0.8] Import: any folder of screenshots and photos into the library, a folder for each source 2026-10-09 08:15:12 +01:00
Labels [0.1.24] GPU memory: OCR runs largest first, gives its arenas' blocks back after each stage, and keeps its worker threads 2026-10-17 21:12:57 -04:00
OCR [0.1.24] GPU memory: OCR runs largest first, gives its arenas' blocks back after each stage, and keeps its worker threads 2026-10-17 21:12:57 -04:00
onnxruntime [0.1.24] GPU memory: OCR runs largest first, gives its arenas' blocks back after each stage, and keeps its worker threads 2026-10-17 21:12:57 -04:00
Screen_Record [0.1.10] Recording toolbar: a System sound button beside Mic 2026-10-10 08:20:13 +01:00
sdl3 [0.0.0] Capture viewer: a grid of every .mcap's preview, and one capture at full size in a window of its own 2026-10-07 11:41:38 +01:00
Secure_Memory [0.0.0] Capture viewer: a grid of every .mcap's preview, and one capture at full size in a window of its own 2026-10-07 11:41:38 +01:00
Segment [0.1.24] GPU memory: OCR runs largest first, gives its arenas' blocks back after each stage, and keeps its worker threads 2026-10-17 21:12:57 -04:00
Serialization [0.0.8] Import: any folder of screenshots and photos into the library, a folder for each source 2026-10-09 08:15:12 +01:00
Shared_Memory_Channel [0.0.0] Capture viewer: a grid of every .mcap's preview, and one capture at full size in a window of its own 2026-10-07 11:41:38 +01:00
Snagx [0.0.8] Import: any folder of screenshots and photos into the library, a folder for each source 2026-10-09 08:15:12 +01:00
Thread [0.0.0] Capture viewer: a grid of every .mcap's preview, and one capture at full size in a window of its own 2026-10-07 11:41:38 +01:00
XDG [0.0.0] Capture viewer: a grid of every .mcap's preview, and one capture at full size in a window of its own 2026-10-07 11:41:38 +01:00
Hash_Table.jai [0.0.0] Capture viewer: a grid of every .mcap's preview, and one capture at full size in a window of its own 2026-10-07 11:41:38 +01:00
Runtime_Support.jai [0.0.0] OCR: an onnxruntime module and an OCR module, PP-OCRv5 mobile and server, on the GPU through CUDA when it can 2026-10-07 20:45:05 +01:00