Skip to content

Commit 6297148

Browse files
committed
utop: Print IDF heap details.
Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
1 parent f60a76a commit 6297148

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

micropython/utop/utop.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,23 @@ def top(update_interval_ms=1000, timeout_ms=None, thread_names={}):
7777
micropython.mem_info()
7878
line_count += 3
7979

80+
if esp32 is not None:
81+
print("\x1b[K")
82+
line_count += 1
83+
for name, cap in (("data", esp32.HEAP_DATA), ("exec", esp32.HEAP_EXEC)):
84+
heaps = esp32.idf_heap_info(cap)
85+
print(
86+
"IDF heap ({}): {} regions, {} total, {} free, {} largest contiguous, {} min free watermark\x1b[K".format(
87+
name,
88+
len(heaps),
89+
sum((h[0] for h in heaps)),
90+
sum((h[1] for h in heaps)),
91+
max((h[2] for h in heaps)),
92+
sum((h[3] for h in heaps)),
93+
)
94+
)
95+
line_count += 1
96+
8097
if previous_line_count > line_count:
8198
for _ in range(previous_line_count - line_count):
8299
print("\x1b[K")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy