本文整理匯總了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)