Pixhawk 5X PX4 v1.17.0 – RAM usage reaches ~99% when automatic logging starts
Hi,
I am setting up a Holybro Pixhawk 5X running PX4 v1.17.0 stable and am encountering a repeatable RAM usage too high warning when the vehicle is armed and automatic ULog logging starts.
I have been troubleshooting the issue and have isolated it to the logger buffer allocation.
Hardware / Software
-
Flight controller: Holybro Pixhawk 5X
-
Hardware target:
PX4_FMU_V5X -
Hardware version:
V5X -
PX4 version:
v1.17.0 -
PX4 git branch:
stable -
Build variant:
default -
MCU:
STM32F76xxx, rev. Z -
QGroundControl: 5.1.3
-
SD card: SanDisk Extreme 32 GB
The normal startup configuration appears to start the logger as:
logger start -b 40 -t -m file
and rc.board_arch_defaults contains:
set LOGGER_BUF 40
COM_RAM_MAX remains at the default value of 95%.
Observed RAM usage
With logging disabled, free shows approximately 86% heap utilisation.
With the automatic logger running but not yet recording, RAM usage is approximately 89–90%.
Once automatic logging starts, RAM usage rises to approximately 98.9–99.1%, leaving only around 4 KB free, and QGroundControl reports:
RAM usage too high
For example, during automatic logging:
-
Total heap: 429,776 B
-
Used: 425,152–425,872 B
-
Free: approximately 3.9–4.6 KB
-
Largest free block: approximately 2.5–2.6 KB
Logger buffer testing
I also tested smaller logger buffers manually.
12 KiB buffer
logger start -m file -b 12
-
RAM usage: approximately 93%
-
Max buffer usage: 11,723 / 12,288 B
-
2 logging dropouts observed
-
Maximum dropout: 0.096 s
16 KiB buffer
logger start -m file -b 16
-
RAM usage: approximately 94.3%
-
Free RAM: 24,416 B
-
Max buffer usage after several minutes: 12,813 / 16,384 B
-
Logging rate: approximately 42 KiB/s
-
Dropouts: 0
Therefore, 16 KiB appears to provide enough logging buffer in my stationary test while keeping RAM below COM_RAM_MAX, whereas the normal 40 KiB configuration pushes RAM usage to approximately 99%.
SD card check
I initially suspected the SD card. The original card had relatively poor write latency, so I replaced it with a SanDisk Extreme 32 GB.
sd_bench -r 100 with the new card gave approximately:
-
Average sequential write: 968 KB/s
-
Maximum write time: 24 ms
-
fsync typically around 5–19 ms
However, the ~99% RAM condition with the automatic 40 KiB logger remained, so the RAM warning does not appear to be caused by the original slow SD card.
Questions
Is approximately 99% RAM utilisation expected on PX4 v1.17.0 on the FMUv5X/Pixhawk 5X when the default automatic logger starts?
In particular:
-
Is
LOGGER_BUF=40the intended/recommended value for FMUv5X on v1.17.0? -
Is it safe/recommended to reduce the logger buffer on this target, for example to 16 KiB?
-
Is there a supported persistent method of changing
LOGGER_BUF, rather than modifying the PX4 startup scripts? -
Could this indicate an unexpectedly high baseline RAM usage or a regression in v1.17.0?
-
Would you recommend testing another PX4 release/build before changing the logger configuration?
I have not increased COM_RAM_MAX or otherwise suppressed the warning, and I have not made any permanent changes to the logger startup configuration.
Any guidance on the expected RAM usage and recommended logger configuration for FMUv5X would be appreciated.