Demystifying Memory: A Practical Tutorial on Managing & Optimizing Memory in Zephyr
summary
Hands‑on Zephyr memory tuning for an nRF5340 + nRF7002 product that starts with only 61 KB flash and 69 KB RAM for application code, using the Azure IoT Hub sample as the baseline. Shows concrete tools: west build + punkcover and nm/addr2line for static reports, thread analyzer and heap/mempool shell commands for runtime stats. Finds embedTLS heap ~81KB used 50KB, tunes k_heap/memory slabs, reduces stacks and network buffers, disables IPv6 to shrink flash and speed connect, reclaims 8 KB from TFM — and doubles usable RAM for the app.
AI-written summary · about
chapters (14)
- 0:00Memory management in Zephyr
- 6:04Flash and RAM basics
- 8:14Heap and slab techniques
- 12:32Memory analysis tools
- 16:52Heap runtime analysis
- 21:13Network stack memory
- 24:53Memory optimization strategy
- 28:45Demo: puncover tool
- 33:47Analyzing memory with puncover
- 36:59RAM runtime analysis
- 41:13Flash partition table
- 43:28Optimization results
- 45:58Key learnings
- 48:28Closing remarks
related talks
51mDemystifying Memory: A Practical Tutorial on Managing & Optimizing Memory in Zephyr
41mZephyr RTOS: Under 1KB of RAM
40mInspecting and Optimizing Memory Usage in Linux
34mZephyr Footprint – Where Are We and Where Are We Going
46mRedis Memory Optimization
29mTowards an Alternative Memory Architecture
40m640K ought to be enough for anyone
38mDeferred Memblocks Init for Boot Time Reduction
