Wrote my own #allocator using the #Rust allocator api(the forever unstable/nightly feature) to use the PSRAM on my microcontroller. I will always be amazed by how far Rust got as a systems language without support for custom allocators.
🎩✨ Ah, the thrilling chronicles of kmalloc() and its trusty sidekick, the #SLUB allocator! Forget the Avengers; this dynamic duo will leave you... yawning. 🤓💤 Canonical's very own superhero sustainer, armed with MIT-licensed wisdom, bravely delves into the abyss of #kernel #internals, ensuring we all have a new #bedtime story. 📚😴
https://ruffell.nz/programming/writeups/2019/02/15/looking-at-kmalloc-and-the-slub-memory-allocator.html #kmalloc #allocator #stories #MIT #licensed #HackerNews #ngated
Looking at kmalloc() and the SLUB Memory Allocator · Matthew Ruffell

🌗 Default musl allocator 拖慢效能,建議替換
➤ 揭開 musl 預設配置器效能瓶頸的真相
https://nickb.dev/blog/default-musl-allocator-considered-harmful-to-performance/
作者發現使用 musl C 函式庫時,預設的記憶體配置器(allocator)在多執行緒環境下效能顯著下降,甚至造成 7 倍的減慢。透過替換為 mimalloc 或 jemalloc 等配置器,可大幅改善效能。儘管 musl 在建立靜態執行檔方面有優勢,但在效能敏感的應用程式中,替換預設配置器是個值得採取的步驟,即使目前不是 musl 目標環境。
+ 這篇文章深入探討了 musl 預設配置器的問題,替換成 mimalloc 的建議很有用。我自己的專案也遇到類似情況,換了之後效能改善很多。
+ 雖然我目前專案不是用 musl,但瞭解這個潛在問題很重要。感謝作者詳細的分析和實作建議。
#效能 #musl #allocator #Rust #mimalloc
Default musl allocator considered harmful (to performance)

In a real world benchmark, the default musl allocator caused a 7x slowdown compared to other allocators. I recommend all Rust projects immediately swap to a different allocator in a musl environment.

nickb.dev
[PATCH RFC 00/10] btrfs: new performance-based chunk allocation using device roles [LWN.net]

Trying to further improve #swad, and as I'm still unhappy with the amount of memory needed ....

Well, this little and special custom #allocator (only dealing with equally sized objects on a single thread and actively preventing #fragmentation) reduces the resident set in my tests by 5 to 10 MiB, compared to "pooling" with linked lists in whatever #FreeBSD's #jemalloc serves me. At least something. 🙈

https://github.com/Zirias/poser/blob/master/src/lib/core/objectpool.c

The resident set now stabilizes at 79MiB after many runs of my somewhat heavy jmeter test simulating 1000 distinct clients.

poser/src/lib/core/objectpool.c at master · Zirias/poser

POsix SERvices framework for C. Contribute to Zirias/poser development by creating an account on GitHub.

GitHub

OSDEV: Разработка аллокатора на С++ часть 2: Слияние блоков за константное время. Юнит тест для аллокатора

Приветствую, уважаемый читатель! В первой части мы реализовали простейший аллокатор с минимальным оверхедом. Конечно же на самом деле все сложнее. Так реализация дефрагментации была наивной и не могла сливать блоки даже когда не было распределенных блоков после нескольких вызовов mem_free. Для того, что бы получить исходную картинку где будет только 2 служебных блока и один свободный нужно было бы вызвать mem_alloc с размером большим чем доступно памяти что бы искусственно запустить дефрагментацию. В этой части мы это исправим и напишем юнит тест для нашего аллокатора что бы убедится что он работает правильно.

https://habr.com/ru/articles/861930/

#распределение_памяти #allocator #memory_allocation #memory_management

OSDEV: Разработка аллокатора на С++ часть 2: Слияние блоков за константное время. Юнит тест для аллокатора

Приветствую, уважаемый читатель! В первой части мы реализовали простейший аллокатор с минимальным оверхедом. Конечно же на самом деле все сложнее. Так реализация дефрагментации была наивной и не могла...

Хабр

This has been a crazy busy period for me, but finally last night I found some time to finish and publish a new #Rust #Crate: please welcome teaspoon, a compact memory allocator for environments with very limited memory!

https://docs.rs/teaspoon

Feedback is welcome.

#RustLang #memory #allocator

teaspoon - Rust

Teaspoon: an allocator for when all you have is a teaspoon of memory.

What is in a Rust Allocator? - sulami's blog

Weak Opinions, Strongly Held

GitHub - apple-oss-distributions/bmalloc

Contribute to apple-oss-distributions/bmalloc development by creating an account on GitHub.

GitHub

It brings the following interesting features:

• Generally faster and/or more memory efficient than alternatives
• Scales better to multiple cores for some workloads than alternatives
• Custom Out-Of-Memory handlers for just-in-time heap management and recovery
• Supports creating and resizing arbitrarily many heaps
• Optional allocation statistics
• Partial validation in debug

#RustLang #memory #allocator