Elektrine lite

← Feed

@klausi@mastodon.social

Post #1436000

2026-04-19 10:46 UTC

One thing that #RustLang does not prevent are memory leaks. Experienced today in #mago https://github.com/carthage-software/mago/issues/1670 It would be awesome if you could compile a program with a cap of let's say 2 GB RAM. If the allocator goes over that then the program should kill itself instead of eating all memory and crashing my computer. At least I can provide a safe way to reproduce with a memory limit on a #Docker container.

Replies (1)

  • @manpacket@functional.cafe 2026-04-19 12:04

    @klausi@mastodon.social Yeah, leaking memory is totally safe thing to do in Rust. For limiting memory usage you can look for a custom allocator (cap crate seem to be able to help, haven't used it myself) or an external solution like cgroups (works great, assuming Linux)

    Open ##3037450