LoginSignup
2
3

More than 5 years have passed since last update.

めざせpythonライブラリマスター (23)memory_utils

Posted at

【ライブラリ説明】

 メモリ操作

【プログラム】

memory_utils.py
# -*- coding: utf-8 -*-

import memory_utils as memo

x = []
for i in xrange(100000):
    x.append(i)
    # メモリの上限を設定
    memo.set_memory_limit(12800000)
    # 上限を超えたら例外を発生させる
    memo.check_memory()
    # メモリプリント
    memo.print_memory()

【結果】

memory.png

【参考サイト】

 github

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3