As recommended by the documentation I am using the malloc/free in the common libc branch.
This code (in zephyr/lib/libc/common/source/stdlib/malloc.c) uses sys_heap_init() with a struct sys_heap that it creates (in my config with CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=-1) using a heap_base just after _end, and running to the end of RAM. (around 300K).
I would like to be able to log the heap current usage and high water mark during the run of the firmware.
I have found the posts about enabling CONFIG_SYS_HEAP_RUNTIME_STATS and using code like this: