I wrote about the memory woes I've been experiencing once I deployed this application to production. One of the solutions I came to learn about was the use of custom allocators.
You see, Rust uses its inbuilt standard allocator that depends on libmalloc. Sometime prior to version 1.32 it was using jemalloc, a FreeBSD memory allocator. Unfortunately, jemalloc is dead as we speak. Yet, many Rust tuorials and posts recommend it. When I tried it out the build failed so jemalloc should not be used.
But there are other better alternatives to Rust's standard allocator and jemalloc:
jemalloc and it comes with some of the best memory security features.There are Rust crates for each but if you would like to use a single shot to activate the best memory allocator depending on the architecture you are deploying to you can use the Malloc Best Effort crate.
Back to work now in trying to set up a memory allocator for this application and watch it carefully to see where the bad memory usage problem is coming from.
WORDCOUNT: 211 words.