Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
d715ea84
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d715ea84
编写于
1月 05, 2012
作者:
J
jmasa
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
ea304dfd
c182ec48
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
4 deletion
+26
-4
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+18
-4
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
+8
-0
未找到文件。
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
浏览文件 @
d715ea84
...
...
@@ -591,17 +591,29 @@ HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool do_expand) {
}
res
=
new_region_try_secondary_free_list
();
}
if
(
res
==
NULL
&&
do_expand
)
{
if
(
res
==
NULL
&&
do_expand
&&
_expand_heap_after_alloc_failure
)
{
// Currently, only attempts to allocate GC alloc regions set
// do_expand to true. So, we should only reach here during a
// safepoint. If this assumption changes we might have to
// reconsider the use of _expand_heap_after_alloc_failure.
assert
(
SafepointSynchronize
::
is_at_safepoint
(),
"invariant"
);
ergo_verbose1
(
ErgoHeapSizing
,
"attempt heap expansion"
,
ergo_format_reason
(
"region allocation request failed"
)
ergo_format_byte
(
"allocation request"
),
word_size
*
HeapWordSize
);
if
(
expand
(
word_size
*
HeapWordSize
))
{
// Even though the heap was expanded, it might not have reached
// the desired size. So, we cannot assume that the allocation
// will succeed.
// Given that expand() succeeded in expanding the heap, and we
// always expand the heap by an amount aligned to the heap
// region size, the free list should in theory not be empty. So
// it would probably be OK to use remove_head(). But the extra
// check for NULL is unlikely to be a performance issue here (we
// just expanded the heap!) so let's just be conservative and
// use remove_head_or_null().
res
=
_free_list
.
remove_head_or_null
();
}
else
{
_expand_heap_after_alloc_failure
=
false
;
}
}
return
res
;
...
...
@@ -1838,6 +1850,7 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) :
_young_list
(
new
YoungList
(
this
)),
_gc_time_stamp
(
0
),
_retained_old_gc_alloc_region
(
NULL
),
_expand_heap_after_alloc_failure
(
true
),
_surviving_young_words
(
NULL
),
_full_collections_completed
(
0
),
_in_cset_fast_test
(
NULL
),
...
...
@@ -5439,6 +5452,7 @@ void G1CollectedHeap::enqueue_discovered_references() {
}
void
G1CollectedHeap
::
evacuate_collection_set
()
{
_expand_heap_after_alloc_failure
=
true
;
set_evacuation_failed
(
false
);
g1_rem_set
()
->
prepare_for_oops_into_collection_set_do
();
...
...
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
浏览文件 @
d715ea84
...
...
@@ -285,6 +285,14 @@ private:
// Typically, it is not full so we should re-use it during the next GC.
HeapRegion
*
_retained_old_gc_alloc_region
;
// It specifies whether we should attempt to expand the heap after a
// region allocation failure. If heap expansion fails we set this to
// false so that we don't re-attempt the heap expansion (it's likely
// that subsequent expansion attempts will also fail if one fails).
// Currently, it is only consulted during GC and it's reset at the
// start of each GC.
bool
_expand_heap_after_alloc_failure
;
// It resets the mutator alloc region before new allocations can take place.
void
init_mutator_alloc_region
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录