Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
992c31af
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看板
提交
992c31af
编写于
9月 18, 2012
作者:
J
jmasa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7197557: NPG: nsk/sysdict/vm/stress/chain/chain004 hangs intermittently
Reviewed-by: johnc, ysr
上级
0fbffdb6
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
51 addition
and
10 deletion
+51
-10
src/share/vm/gc_implementation/shared/vmGCOperations.cpp
src/share/vm/gc_implementation/shared/vmGCOperations.cpp
+3
-9
src/share/vm/memory/collectorPolicy.cpp
src/share/vm/memory/collectorPolicy.cpp
+30
-0
src/share/vm/memory/metaspace.cpp
src/share/vm/memory/metaspace.cpp
+15
-0
src/share/vm/memory/metaspace.hpp
src/share/vm/memory/metaspace.hpp
+3
-1
未找到文件。
src/share/vm/gc_implementation/shared/vmGCOperations.cpp
浏览文件 @
992c31af
...
...
@@ -230,15 +230,9 @@ void VM_CollectForMetadataAllocation::doit() {
// amount of the expansion.
// This should work unless there really is no more space
// or a MaxMetaspaceSize has been specified on the command line.
MetaspaceGC
::
set_expand_after_GC
(
true
);
size_t
before_inc
=
MetaspaceGC
::
capacity_until_GC
();
size_t
delta_words
=
MetaspaceGC
::
delta_capacity_until_GC
(
_size
);
MetaspaceGC
::
inc_capacity_until_GC
(
delta_words
);
if
(
PrintGCDetails
&&
Verbose
)
{
gclog_or_tty
->
print_cr
(
"Increase capacity to GC from "
SIZE_FORMAT
" to "
SIZE_FORMAT
,
before_inc
,
MetaspaceGC
::
capacity_until_GC
());
}
_result
=
_loader_data
->
metaspace_non_null
()
->
allocate
(
_size
,
_mdtype
);
_result
=
_loader_data
->
metaspace_non_null
()
->
expand_and_allocate
(
_size
,
_mdtype
);
if
(
do_cms_concurrent
&&
_result
==
NULL
)
{
// Rather than fail with a metaspace out-of-memory, do a full
// GC for CMS.
...
...
src/share/vm/memory/collectorPolicy.cpp
浏览文件 @
992c31af
...
...
@@ -743,6 +743,36 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation(
uint
full_gc_count
=
0
;
do
{
MetaWord
*
result
=
NULL
;
if
(
GC_locker
::
is_active_and_needs_gc
())
{
// If the GC_locker is active, just expand and allocate.
// If that does not succeed, wait if this thread is not
// in a critical section itself.
result
=
loader_data
->
metaspace_non_null
()
->
expand_and_allocate
(
word_size
,
mdtype
);
if
(
result
!=
NULL
)
{
return
result
;
}
JavaThread
*
jthr
=
JavaThread
::
current
();
if
(
!
jthr
->
in_critical
())
{
MutexUnlocker
mul
(
Heap_lock
);
// Wait for JNI critical section to be exited
GC_locker
::
stall_until_clear
();
// The GC invoked by the last thread leaving the critical
// section will be a young collection and a full collection
// is (currently) needed for unloading classes so continue
// to the next iteration to get a full GC.
continue
;
}
else
{
if
(
CheckJNICalls
)
{
fatal
(
"Possible deadlock due to allocating while"
" in jni critical section"
);
}
return
NULL
;
}
}
{
// Need lock to get self consistent gc_count's
MutexLocker
ml
(
Heap_lock
);
gc_count
=
Universe
::
heap
()
->
total_collections
();
...
...
src/share/vm/memory/metaspace.cpp
浏览文件 @
992c31af
...
...
@@ -2843,6 +2843,21 @@ MetaWord* Metaspace::allocate(size_t word_size, MetadataType mdtype) {
}
}
MetaWord
*
Metaspace
::
expand_and_allocate
(
size_t
word_size
,
MetadataType
mdtype
)
{
MetaWord
*
result
;
MetaspaceGC
::
set_expand_after_GC
(
true
);
size_t
before_inc
=
MetaspaceGC
::
capacity_until_GC
();
size_t
delta_words
=
MetaspaceGC
::
delta_capacity_until_GC
(
word_size
);
MetaspaceGC
::
inc_capacity_until_GC
(
delta_words
);
if
(
PrintGCDetails
&&
Verbose
)
{
gclog_or_tty
->
print_cr
(
"Increase capacity to GC from "
SIZE_FORMAT
" to "
SIZE_FORMAT
,
before_inc
,
MetaspaceGC
::
capacity_until_GC
());
}
result
=
allocate
(
word_size
,
mdtype
);
return
result
;
}
// Space allocated in the Metaspace. This may
// be across several metadata virtual spaces.
char
*
Metaspace
::
bottom
()
const
{
...
...
src/share/vm/memory/metaspace.hpp
浏览文件 @
992c31af
...
...
@@ -130,9 +130,11 @@ class Metaspace : public CHeapObj<mtClass> {
static
MetaWord
*
allocate
(
ClassLoaderData
*
loader_data
,
size_t
size
,
bool
read_only
,
MetadataType
mdtype
,
TRAPS
);
void
deallocate
(
MetaWord
*
ptr
,
size_t
byte_size
,
bool
is_class
);
MetaWord
*
expand_and_allocate
(
size_t
size
,
MetadataType
mdtype
);
#ifndef PRODUCT
bool
contains
(
const
void
*
ptr
)
const
;
bool
contains_class
(
const
void
*
ptr
)
const
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录