linux_utils.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:iotracer 作者: b-com 项目源码 文件源码
def clear_cache():
    # flush file system buffers
    os.sync()
    # force kernel to drop clean caches
    try:
        subprocess.check_call("sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'",
                              stderr=subprocess.STDOUT,
                              universal_newlines=True,
                              shell=True)
    except Exception as err:
        print('Fail to drop clean caches: %s' % (err))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号