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.
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
🌗 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
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.
OSDEV: Разработка аллокатора на С++ часть 2: Слияние блоков за константное время. Юнит тест для аллокатора
Приветствую, уважаемый читатель! В первой части мы реализовали простейший аллокатор с минимальным оверхедом. Конечно же на самом деле все сложнее. Так реализация дефрагментации была наивной и не могла сливать блоки даже когда не было распределенных блоков после нескольких вызовов mem_free. Для того, что бы получить исходную картинку где будет только 2 служебных блока и один свободный нужно было бы вызвать mem_alloc с размером большим чем доступно памяти что бы искусственно запустить дефрагментацию. В этой части мы это исправим и напишем юнит тест для нашего аллокатора что бы убедится что он работает правильно.
https://habr.com/ru/articles/861930/
#распределение_памяти #allocator #memory_allocation #memory_management
Don’t worry bmalloc #apple #allocator #oss https://github.com/apple-oss-distributions/bmalloc
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
Talc, https://github.com/SFBdragon/talc.
A memory allocator built in Rust, for Rust. It is for embedded system, OS kernels or other no_std environments. It is also for WebAssembly.
Wrote a #LockFree (and Obstruction-Free) memory #allocator for use in low-latency real-time threads.
Blocks are 64-byte aligned to avoid false sharing, alloc+free calls of the underlying Bucket- and Bump-Allocators are O(1).
A seperate thread is notified when the Bump-Allocator reaches a watermark. It will then extend the pool of pre-allocated (and pre-faulted) memory, so the Bump-Allocator can continue to serve requests concurrently without syscalls.
https://github.com/tim-janik/anklang/blob/trunk/ase/loft.hh
#Anklang
#mastodon #sidekiq #ruby #memory #allocator
jemalloc > 2GB 😱
glibc malloc > 2GB 😱
mimalloc > 2GB 😱
3年前の記事に書かれていた"jemallocで解決"は今回の問題に対して適切ではなかったということ(´・ω・) スナ...
chill software co-working // rustlang no_std slightly-alloc // 2020-12-18 https://diode.zone/videos/watch/496f7a10-b6df-4a08-a768-47b202b4ba6d
mimalloc, https://github.com/microsoft/mimalloc.
A compact, general-purpose, drop-in replacement for malloc, memory allocator.
Benchmarks show it always outperforms all other leading allocators (jemalloc, tcmalloc, Hoard…) and usually uses less memory.
bumpalo, a fast bump allocation area for Rust, https://github.com/fitzgen/bumpalo