本站改版新增arduino频道
micropython.mem_info(level)
函数说明: 打印当前内存使用的情况(包括栈和堆的使用量)。
注意:
如果给出参数level(任何数据类型),则打印出更加详细的信息,它会打印整个堆,指示哪些内存块被使用,哪些内存是空闲的。
示例一: 不给参数
import micropython
micropython.mem_info()
stack: 736 out of 15360
GC: total: 48000, used: 7984, free: 40016
No. of 1-blocks: 72, 2-blocks: 31, max blk sz: 264, max free sz: 2492
>>>
示例二: 给定参数
>>>micropython.mem_info("level")
stack: 752 out of 15360
GC: total: 48000, used: 8400, free: 39600
No. of 1-blocks: 82, 2-blocks: 36, max blk sz: 264, max free sz: 2466
GC memory layout; from 3ffc4930:
00000: h=ShhBMh=DhBhDBBBBhAh===h===Ahh==h==============================
00400: ================================================================
00800: ================================================================
00c00: ================================================================
01000: =========================================hBh==Ah=ShShhThhAh=BhBh
01400: hhBhTShh=h==h=hh=Bh=BDhhh=hh=Bh=hh=Bh=BhBh=hh=hh=h===h=Bhh=h=BhB
01800: h=hh=h=Bh=hBh=h=hBh=h=hBh=h=h=hh=======h========================
01c00: ============================================Bh=hBhTh==hh=hh=Sh=h
02000: h==Bh=B..h...h==....h=..........................................
(37 lines all free)
0b800: ........................................................
>>>
Copyright © 2014 ESP56.com All Rights Reserved
晋ICP备14006235号-22 晋公网安备14108102001165号
执行时间: 0.014066934585571 seconds