8000 docs/esp32: Update ESP32 idf_heap_info docs to match new behaviour. · micropython/micropython@7d936c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d936c1

Browse files
committed
docs/esp32: Update ESP32 idf_heap_info docs to match new behaviour.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent 95bb80a commit 7d936c1

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

docs/library/esp32.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,6 @@ Functions
5656
two most useful ones are predefined as `esp32.HEAP_DATA` for data heap regions and
5757
`esp32.HEAP_EXEC` for executable regions as used by the native code emitter.
5858

59-
Free IDF heap memory in the `esp32.HEAP_DATA` region is available to be
60-
automatically added to the MicroPython heap to prevent a MicroPython
61-
allocation from failing. However, the information returned here is otherwise
62-
*not* useful to troubleshoot Python allocation failures, use
63-
`micropython.mem_info()` instead. The "max new split" value in
64-
`micropython.mem_info()` output corresponds to the largest free block of
65-
ESP-IDF heap that could be automatically added on demand to the MicroPython
66-
heap.
67-
6859
The return value is a list of 4-tuples, where each 4-tuple corresponds to one heap
6960
and contains: the total bytes, the free bytes, the largest free block, and
7061
the minimum free seen over time.
@@ -75,6 +66,21 @@ Functions
7566
[(240, 0, 0, 0), (7288, 0, 0, 0), (16648, 4, 4, 4), (79912, 35712, 35512, 35108),
7667
(15072, 15036, 15036, 15036), (113840, 0, 0, 0)]
7768

69+
.. note:: Free IDF heap memory in the `esp32.HEAP_DATA` region is available
70+
to be automatically added to the MicroPython heap to prevent a
71+
MicroPython allocation from failing. However, the information returned
72+
here is otherwise *not* useful to troubleshoot Python allocation
73+
failures. :func:`micropython.mem_info()` and :func:`gc.mem_free()` should
74+
be used instead:
75+
76+
The "max new split" value in :func:`micropython.mem_info()` output
77+
corresponds to the largest free block of ESP-IDF heap that could be
78+
automatically added on demand to the MicroPython heap.
79+
80+
The result of :func:`gc.mem_free()` is the total of the current "free"
81+
and "max new split" values printed by :func:`micropython.mem_info()`.
82+
83+
7884
Flash partitions
7985
----------------
8086

0 commit comments

Comments
 (0)
0