如何真正释放Linux中的大页面以供新进程使用? [英] How to really free hugepages in Linux for use by a new process?

查看:985
本文介绍了如何真正释放Linux中的大页面以供新进程使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

真的找不到这个...希望有人可以提供帮助。我正在假装一个100GB的Java堆作为大数据缓存。为了避免与文件系统缓存之类的事情发生冲突,并且因为它在一般情况下表现更好,我将在大页面中进行分配。

Really can't find much about this.. hopefully someone can help. I'm spooling up a 100GB java heap to serve as a big data cache. In order to avoid conflicts with things like the filesystem cache, and because it performs better in general, I'm allocating this in large pages.

我保留了51,200 x 2MB大页面,一切都很好。然而,当我终止进程并重新启动时,看起来Linux会将这些页面中的某些页面保留为'rsvd'。

I've reserved 51,200 x 2MB huge pages and everything starts up just fine. When I kill the process and restart, however, it looks like Linux leave some of these pages as 'rsvd'.

# less /proc/meminfo | grep Hug
AnonHugePages:         0 kB
HugePages_Total:   52000
HugePages_Free:    50952
HugePages_Rsvd:     1634
HugePages_Surp:        0
Hugepagesize:       2048 kB

据我所知,系统上没有任何其他配置为请求或保留这些页面的内容。 Linux是否为我提供了一种方法,让我能够看到保留这些内容和/或使预订无效的内容?

As far as I know I don't have anything else on the system configured to be requesting or reserving those pages. Does Linux provide a way for me to either see what is keeping those reserved and/or invalidate that reservation?

从我发现谷歌的所有内容中他们实际上并不是使用,只是Linux保留了它们,虽然有趣的是在重新启动我的巨大JVM时不允许我使用它们。

From everything I'm finding google they're not actually being USED, just that Linux is holding them in reserve, though interestingly not allowing my to use them when re-starting my huge JVM.

任何帮助都会很棒。

推荐答案

您很可能让Java重新使用仍在内存中的对象,但是,运行以下内容将删除它以及其他所有内容存储和未使用

You can very likely get Java to re use the objects still in memory, However, running the following will remove that and everything else also stored and not being used

echo 3 | sudo tee /proc/sys/vm/drop_caches 

但你真的不需要 - 尽管它被采取它不是真的。只要有任何实际需要,ram linux就会将其退回

But you dont really need to - although its "taken" its not really. As soon as anything actually needs the ram linux will give it back

了解更多信息请查看 http://www.linuxatemyram.com/

你实际上并不需要做任何正常的事情。你需要担心的唯一内存就是应用程序运行时的内存

You dont actually need to do anything its normal. The only memory you have to worry about really is the memory when your application is running

这篇关于如何真正释放Linux中的大页面以供新进程使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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