u/Compux72in r/rust • Recommends
On “My Rust program (Well, game) is leaking memory, 4MB/s.”
You sure is a memory leak and not the allocator ballooning memory?
link to this video
57K subscribers • 8 videos on Hallway
Intermediate. Assumes working knowledge.
64K views3 years ago3 recommendations
Systems programmingProgramming languagesRustMemory managementOperating systems
fasterthanlime explains how memory allocators, virtual memory, RSS, and the madvise system call affect memory usage in Rust programs.
Follow me on Mastodon: hachyderm.io/@fasterthanlime Support my work: fasterthanli.me/donate Thanks to Omer from Egypt for submitting this question: github.com/mariocynicys/mem-hog Submit your own questions: fasterthanli.me/submit Making our own executable packer: fasterthanli.me/series/making-our-own-executable-packer Contents What does the program do? Memory usage, Vec, and jemalloc How does malloc even work? Visualizing allocations with memusage Where is the heap? /proc/PID/maps Virtual memory vs RSS Tracing syscalls with strace Virtual memory vs physical memory The madvise syscall What's technique 2 doing? Iterator size hints What's technique 3 doing? Mystery solved Thanks & outroWhat people say. Recommended to help understand whether a Rust program is actually leaking memory or if the allocator is just ballooning memory.
u/Compux72in r/rust • Recommends
On “My Rust program (Well, game) is leaking memory, 4MB/s.”
u/Luxalpain r/rust • Recommends
On “Is moving to rust from c# easy?”
u/wageofin r/kubernetes • Recommends
On “High memory usage on Java app pod”