mirror of
https://github.com/deepseek-ai/3FS.git
synced 2026-11-05 00:47:47 +00:00
[GH-ISSUE #334] Shared memory leakage issue due to symlink to /dev/shm not deleted #203
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/3FS#203
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Originally created by @McFurryIsNotMcFlurry on GitHub (Aug 31, 2025).
Original GitHub issue: https://github.com/deepseek-ai/3FS/issues/334
When a client process reading files via
hf3fs_fuse.ioAPIs exited abruptly (such as being killed by SIGKILL), the symlinks under/3fs/3fs-virt/iovs/are not removed (becauseiovec.__del__is not called), and since those symlinks are pointing to shared memories under/dev/shm, those shared memories will never be freed unless someone manually delete those symlinks, or restart the entirehf3fs_fuse_mainservice.And of course there're other scenarios in which
iovec.__del__is not called, for example malformed user programs which contains cyclic reference. But if I expect 3FS to serve as a robust fundamental filesystem, which should withstand improper user use cases, what is the proper way to cope with this memory leakage issue?@McFurryIsNotMcFlurry commented on GitHub (Sep 1, 2025):
Further investigation shows that, after read process termination, those symlinks under
/3fs/3fs-virt/iovs/are actually dangling - they're pointing to non-existent items under/dev/shm. I believe those items under/dev/shm, created bymultiprocessing.shared_memory.SharedMemory, are cleared bymultiprocessing.resource_tracker, a daemon that does the clean-up job after the read process exited abruptly. However theiovecobjects lack such mechanism, and thus those links under/3fs/3fs-virt/iovs/will remain after abrupt exit.This raises more question - why do those dangling symlinks under
/3fs/3fs-virt/iovs/affect the amount of residual shared memory, since manually delete those symlinks will actually cause the residual memory ofhf3fs_fuse_mainprocess to drop?@lcxywfe commented on GitHub (Jan 8, 2026):
Same issue