如何从崩溃的应用程序中释放大页面 [英] How to release hugepages from the crashed application

查看:132
本文介绍了如何从崩溃的应用程序中释放大页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用大页面的应用程序,由于某些错误,该应用程序突然崩溃了. 崩溃后,由于应用程序无法正确释放大页面,因此sys文件系统中的免费大页面数量不会增加.

I have an application that uses hugepage and the application suddenly crashed due to some bug. After crashing, since the application does not release the hugepage properly, the free hugepage number is not increased in sys filesystem.

$ sudo cat /sys/kernel/mm/hugepages/hugepages-2048kB/free_hugepages 
0
$ sudo cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages 
1024

有没有办法强制释放大页面?

Is there a way to release the hugepages by force?

推荐答案

HugeTLB既可以用于共享内存(Mark J. Bobak的答案也可以用于共享内存),也可以将应用程序mmaps文件创建在hugetlb文件系统中.如果应用程序崩溃而未删除这些文件,它们将继续存在并保持相应的内存已分配".

HugeTLB can either be used for shared memory (and Mark J. Bobak's answer would deal with that) or the app mmaps files created in a hugetlb filesystem. If the app crashes without removing those files they survive and keep corresponding memory 'allocated'.

检查hugeTLB文件系统,查看应用程序是否有剩余文件.删除它们将释放内存.

Check hugeTLB filesystem and see if there are any leftover files from the app. Removing them would release the memory.

这篇关于如何从崩溃的应用程序中释放大页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆