Use PSRAM to reduce heap usage percentage on ESP32 with PSRAM#8891
Conversation
|
Will this cause conflicts with S&F @caveman99? |
There was a problem hiding this comment.
Pull request overview
This PR enables PSRAM utilization on ESP32 boards to reduce heap memory usage from 89% to 55%, improving stability on devices like the LilyGo T-Beam. The changes configure ESP32's memory allocator to use external PSRAM for larger allocations and switch packet pool allocation from static to dynamic on PSRAM-equipped boards.
- Configures ESP32 heap allocator to use PSRAM for allocations ≥256 bytes
- Switches packet memory pool from static to dynamic allocation on boards with PSRAM
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/main.cpp | Adds PSRAM initialization call to enable external memory usage for heap allocations on ESP32 boards with PSRAM |
| src/mesh/Router.cpp | Extends dynamic packet pool allocation logic to include boards with PSRAM, not just STM32WL |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
It should not conflict with S & F but i can test it. S&F uses |
That was my thought as well. Thanks for testing :-) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…stic#8891) * Use PSRAM for malloc > 256bytes to get more heap memory * Use dynamic allocator on boards with PSRAM to free more heap * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Move heap_caps_malloc_extmem_enable() to the top of the init * Update src/main.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…stic#8891) * Use PSRAM for malloc > 256bytes to get more heap memory * Use dynamic allocator on boards with PSRAM to free more heap * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Move heap_caps_malloc_extmem_enable() to the top of the init * Update src/main.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Hi, this is my first PR for the meshtastic project. It is here to address #8732. After applying this patch, I reduced heap consumption from 89% to 55% and saw significant improvements in stability. I am using LilyGo T-Beam device.
🤝 Attestations