弹冠相庆

October 23, 2010

犯错了 (vm_nr_hugepages)

Filed under: Uncategorized — Corey @ 13:58
Tags: ,

问题是这样的:操作系统是RHEL 5.3 64bit,上面装有Oracle和其它应用,开机之后,用top/free/ps等工具查看内存使用情况,发现少了几G内存,不知道被用到哪里去了。

折腾了几天之后,最后发现是有一个内核参数配置过大,导致一开机,有超过预期数量的内存被系统锁住了。因为系统启用了HugePages来分配Oracle的SGA,而在之前的某个时间,我把SGA的值改小了,这个参数(vm_nr_hugepages)又没相应地改小。这个低级错误的根本原因在于没有完全地理解这个参数,惭愧。

还有一个问题,用ipcs -m看到的Shared Memory Segment会比指定的SGA大一点,是什么道理?比如SGA设置为8G,用show sga看到确实是分配了8G(8589934592),而ipcs -m看到却是分配了8592031744,比8G大了2M。这样又导致vm_nr_hugepages=4096的时候 (HugePages size=2M,理论上4096*2M刚好=8G),系统无法成功分配8G内存给SGA,现在是把vm_nr_hugepages设成4196了。看了几篇文章,都没提到有类似问题。

有关Linux HugePages的参考信息

RHEL 5下为Oracle SGA启用huge pages

Memory

MEMORY_TARGET (SGA_TARGET) or HugePages – which to choose?

About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: