Java虚拟机中 -XX:+PrintFlagsFinal与XX:+PrintCommandLineFlags 中MaxHeapSize的值不同的原因
2024-09-08 18:53:26
size_t CollectorPolicy::compute_heap_alignment() {
// The card marking array and the offset arrays for old generations are
// committed in os pages as well. Make sure they are entirely full (to
// avoid partial page problems), e.g. if 512 bytes heap corresponds to 1
// byte entry and the os page size is 4096, the maximum heap size should
// be 512*4096 = 2MB aligned. // There is only the GenRemSet in Hotspot and only the GenRemSet::CardTable
// is supported.
// Requirements of any new remembered set implementations must be added here.
size_t alignment = GenRemSet::max_alignment_constraint(GenRemSet::CardTable); // Parallel GC does its own alignment of the generations to avoid requiring a
// large page (256M on some platforms) for the permanent generation. The
// other collectors should also be updated to do their own alignment and then
// this use of lcm() should be removed.
if (UseLargePages && !UseParallelGC) {
// in presence of large pages we have to make sure that our
// alignment is large page aware
alignment = lcm(os::large_page_size(), alignment);
} return alignment;
}
原因堆被划了一个个card page。
512个card page 便是一个Card Table。
这里假设:一个Card Page的是一个card table 的entry 与一个对应的操作系统内存页是4KB
一个Card Table 总体堆内存最大的size便是 512个(Card Page)*4k(系统内存页)=2MB的内存
最新文章
- WPF面试准备
- Matlab学习笔记 figure函数
- spark spark ziliao important
- Android开发艺术探索笔记—— View(一)
- AS3.0的动态类和密封类
- SQL*Net message from client
- ACM2096_小明A+B
- iOS开发之动画编程的几种方法
- Windows Phone 8初学者开发—第4部分:XAML简介
- (二)----HTTP请求头与响应头
- .Net配置错误页
- bean的作用域 :singleton和prototype
- arcgis 制图-插值图
- 【Python】将对象存成json文件及从json取出对象
- Intellij Idea免费激活方法
- Mysql加锁处理分析-基于InnoDB存储引擎
- vux配置i18n
- PHP处理session跨域
- Code Review: 超越“审、查、评”的代码回顾
- PL/SQL 03 流程控制
热门文章
- 分享自己亲测过的Visualstudio 2019中开发Typescript时,设置自动编译生成js,无需手工运行命令生成的方法。
- Educational Codeforces Round 141 (Rated for Div. 2) A-E
- 【RocketMQ】消息拉模式分析
- linux环境编程(2): 使用pipe完成进程间通信
- vue中wowjs的使用
- centos7连接WIFI
- 【C++ 泛型编程01:模板】函数模板与类模板
- Java8Stream流
- 【一句话】CAP原则
- 样本熵(SampEn)的C/C++代码实现与优化