1.. zephyr:code-sample:: sys-heap 2 :name: System heap 3 4 Print system heap usage to the console. 5 6Overview 7******** 8 9A simple sample that can be used with any :ref:`supported board <boards>` and 10prints system heap usage to the console. 11 12Building 13******** 14 15This application can be built on :ref:`native_sim <native_sim>` as follows: 16 17.. zephyr-app-commands:: 18 :zephyr-app: samples/basic/sys_heap 19 :host-os: unix 20 :board: native_sim 21 :goals: build 22 :compact: 23 24To build for another board, change "native_sim" above to that board's name. 25 26Running 27******* 28 29Run build/zephyr/zephyr.exe 30 31Sample Output 32************* 33 34.. code-block:: console 35 36 System heap sample 37 38 allocated 0, free 196, max allocated 0, heap size 256 39 allocated 156, free 36, max allocated 156, heap size 256 40 allocated 100, free 92, max allocated 156, heap size 256 41 allocated 0, free 196, max allocated 156, heap size 256 42