本文整理汇总了Python中micropython.mem_info方法的典型用法代码示例。如果您正苦于以下问题:Python micropython.mem_info方法的具体用法?Python micropython.mem_info怎么用?Python micropython.mem_info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类micropython
的用法示例。
在下文中一共展示了micropython.mem_info方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import micropython [as 别名]
# 或者: from micropython import mem_info [as 别名]
def main(**params):
gc.collect()
import logging
logging.basicConfig(level=logging.INFO)
# Preload templates to avoid memory fragmentation issues
gc.collect()
app._load_template('homepage.html')
app._load_template('admin.html')
app._load_template('login.html')
gc.collect()
import micropython
micropython.mem_info()
gc.collect()
# starting dns server
dns_server = DNSServer(**params)
dns_server.start()
gc.collect()
# webserver
app.run(debug=True, **params)
示例2: handle_command
# 需要导入模块: import micropython [as 别名]
# 或者: from micropython import mem_info [as 别名]
def handle_command(self, args):
import gc
mem_alloc = gc.mem_alloc()
mem_free = gc.mem_free()
capacity = mem_alloc + mem_free
print(" capacity\tfree\tusage")
print(" {}\t{}\t{}%".format(capacity, mem_free, int(
((capacity - mem_free) / capacity) * 100.0)))
if "-i" in args:
import micropython
micropython.mem_info(1)
示例3: mem
# 需要导入模块: import micropython [as 别名]
# 或者: from micropython import mem_info [as 别名]
def mem(level=None):
import gc
mem_alloc = gc.mem_alloc()
mem_free = gc.mem_free()
capacity = mem_alloc + mem_free
print(" capacity\tfree\tusage")
print(" {}\t{}\t{}%".format(capacity, mem_free, int(
((capacity - mem_free) / capacity) * 100.0)))
if level:
import micropython
micropython.mem_info(level)