Linux系统Large Pages设置

简介:
Large Pages说明

sun文档: http://www.oracle.com/technetwork/java/javase/tech/largememory-jsp-137182.html

说白了,就是在操作系统级别上,针对进程的虚拟内存空间,使用大内存页,避免频繁的进行页换入换出,出现系统抖动。同样使用大内存分页,也会有一些负面影响,两快大内存分页之间会出现一些内存碎片,从而影响整体系统的性能,当一旦没有足够的大内存块时,整个OS下系统进程又会将原先的大内存打散恢复默认的内存分页。

摘自sun文档的原话 写道
A Translation-Lookaside Buffer (TLB) is a page translation cache that holds the most-recently used virtual-to-physical address translations. TLB is a scarce system resource. A TLB miss can be costly as the processor must then read from the hierarchical page table, which may require multiple memory accesses. By using bigger page size, a single TLB entry can represent larger memory range. There will be less pressure on TLB and memory-intensive applications may have better performance.

However please note sometimes using large page memory can negatively affect system performance. For example, when a large mount of memory is pinned by an application, it may create a shortage of regular memory and cause excessive paging in other applications and slow down the entire system. Also please note for a system that has been up for a long time, excessive fragmentation can make it impossible to reserve enough large page memory. When it happens, either the OS or JVM will revert to using regular pages.


Linux下如何配置large Page

Large page support is included in 2.6 kernel. Some vendors have backported the code to their 2.4 based releases. To check if your system can support large page memory, try the following:


1.cat /proc/meminfo | grep Huge  
2.HugePages_Total: 0  
3.HugePages_Free: 0  
4.Hugepagesize: 2048 kB  

If the output shows the three "Huge" variables then your system can support large page memory, but it needs to be configured. If the command doesn't print out anything, then large page support is not available. To configure the system to use large page memory, one must log in as root, then:

Increase SHMMAX value. It must be larger than the Java heap size. On a system with 4 GB of physical RAM (or less) the following will make all the memory sharable: 


1.echo 4294967295 > /proc/sys/kernel/shmmax  

Specify the number of large pages. In the following example 3 GB of a 4 GB system are reserved for large pages (assuming a large page size of 2048k, then 3g = 3 x 1024m = 3072m = 3072 * 1024k = 3145728k, and 3145728k / 2048k = 1536): 


1.echo 1536 > /proc/sys/vm/nr_hugepages  

Note the /proc values will reset after reboot so you may want to set them in an init script (e.g. rc.local or sysctl.conf).

参数配置
sun jdk :


jrockit jdk :



效果

摘录校长的测试结果: 写道
这个设置, 目前观察下来的结果是EDEN区域收集明显速度比较快, 最多几个ms, 但是,对于FGC, 大约需要0。9, 但是发生时间非常的长, 应该是影响不大。 但是对于非web应用的中间件服务, 这个设置很要不得, 可能导致很严重延迟效果.这时需要搭配cms,加速old区的并发收集


相关文章
|
1月前
|
Ubuntu Linux
计算机基础知识:linux系统怎么安装?
在虚拟机软件中创建一个新的虚拟机,并选择相应操作系统类型和硬盘空间大小等参数。将下载的 ISO 镜像文件加载到虚拟机中。启动虚拟机,进入安装界面,并按照步骤进行安装。安装完成后,可以在虚拟机中使用 Linux 系统。
|
1月前
|
缓存 监控 Linux
Linux系统清理缓存(buff/cache)的有效方法。
总结而言,在大多数情形下你不必担心Linux中buffer与cache占用过多内存在影响到其他程序运行;因为当程序请求更多内存在没有足够可用资源时,Linux会自行调整其占有量。只有当你明确知道当前环境与需求并希望立即回收这部分资源给即将运行重负载任务之前才考虑上述方法去主动干预。
568 10
|
1月前
|
安全 Linux 数据安全/隐私保护
为Linux系统的普通账户授予sudo访问权限的过程
完成上述步骤后,你提升的用户就能够使用 `sudo`命令来执行管理员级别的操作,而无需切换到root用户。这是一种更加安全和便捷的权限管理方式,因为它能够留下完整的权限使用记录,并以最小权限的方式工作。需要注意的是,随意授予sudo权限可能会使系统暴露在风险之中,尤其是在用户不了解其所执行命令可能带来的后果的情况下。所以在配置sudo权限时,必须谨慎行事。
266 0
|
1月前
|
Ubuntu Linux 开发者
国产 Linux 发行版再添新成员,CutefishOS 系统简单体验
当然,系统生态构建过程并不简单,不过为了帮助国产操作系统优化生态圈,部分企业也开始用国产操作系统替代 Windows,我们相信肯定会有越来越多的精品软件登录 Linux 平台。
92 0
|
1月前
|
Ubuntu 安全 Linux
Linux系统入门指南:从零开始学习Linux
Shell脚本是一种强大的自动化工具,可以帮助您简化重复的任务或创建复杂的脚本程序。了解Shell脚本的基本语法和常用命令,以及编写和运行Shell脚本的步骤,将使您更高效地处理日常任务。
156 0
|
1月前
|
Ubuntu Linux 图形学
Linux学习之Linux桌面系统有哪些?
Cinnamon:与MATE类似,Cinnamon 拥有 GNOME 和 Unity 等其它桌面环境所没有的种种功能,是高度可定制的桌面环境,不需要任何外部插件、窗口组件和调整工具来定制桌面。
104 0
|
1月前
|
Ubuntu 安全 Linux
十款常用Linux系统介绍
本文不是什么大盘点。市面上有好几百款发行版,每款发行版在某个方面都与众不同。不可能在此全部罗列,本文只罗列了十款最常见的Linux发行版(世界上只有两种人,一种是懂二进制的,另一种是不懂二进制的)。请宣传Linux的魅力或威力。
|
1月前
|
Ubuntu 安全 Linux
linux系统|Ubuntu 18.10 如期正式发布,新面孔新技术都来了
微软公司也终于沉不住气要在linux开源系统开疆扩土了。mscode这样的工具的确好用,虽然差第一名那么一点儿,但是最老版的公司出版的软件的确很是让人动心!
|
1月前
|
Ubuntu Linux 数据安全/隐私保护
Win10安装Linux子系统教程!如何在Win10系统中安装Ubuntu!
登录系统后,输入cd /返回上一级,然后再输入“ls”查看一下系统文件目录,看看对不对!
|
1月前
|
Web App开发 安全 Linux
Linux 比起其他系统的5 个优点和 5 个缺点
对Linux系统感兴趣的朋友,可以点击下方书籍进行学习。

热门文章

最新文章