Loader thread loads all file data into memory causing high memory usage #107
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
load_files_multithreaded()callsfile_load_data()which reads the entire file into a mallocd buffer (up to STREAM_THRESHOLD = 64MB). With queue depth 100 chunks of ~10MB each, memory usage can reach ~1GB.Location
src/client/client_send.c:331-357 (load_files_multithreaded)
src/shared/file.c:92-119 (file_load_data)
Suggested Fix
mmap()instead ofmalloc()+read()for files below STREAM_THRESHOLD — this allows the OS to page data in/outSeverity
high
Category
performance
Sub-Agent
perf-analyst (PA-2)
This issue was automatically generated by the issue-creator agent.
Fixed in PR #148 — merged into main on 2026-07-29.