Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
0d459bfa
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看板
提交
0d459bfa
编写于
12月 03, 2012
作者:
J
jmasa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8005082: NPG: Add specialized Metachunk sizes for reflection and anonymous classloaders
Reviewed-by: johnc, coleenp
上级
73ee7ee2
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
420 addition
and
227 deletion
+420
-227
src/share/vm/classfile/classLoaderData.cpp
src/share/vm/classfile/classLoaderData.cpp
+14
-5
src/share/vm/memory/binaryTreeDictionary.cpp
src/share/vm/memory/binaryTreeDictionary.cpp
+3
-2
src/share/vm/memory/collectorPolicy.cpp
src/share/vm/memory/collectorPolicy.cpp
+9
-0
src/share/vm/memory/metachunk.cpp
src/share/vm/memory/metachunk.cpp
+8
-3
src/share/vm/memory/metachunk.hpp
src/share/vm/memory/metachunk.hpp
+8
-6
src/share/vm/memory/metaspace.cpp
src/share/vm/memory/metaspace.cpp
+361
-207
src/share/vm/memory/metaspace.hpp
src/share/vm/memory/metaspace.hpp
+15
-3
src/share/vm/runtime/globals.hpp
src/share/vm/runtime/globals.hpp
+2
-1
未找到文件。
src/share/vm/classfile/classLoaderData.cpp
浏览文件 @
0d459bfa
...
...
@@ -330,10 +330,19 @@ Metaspace* ClassLoaderData::metaspace_non_null() {
}
if
(
this
==
the_null_class_loader_data
())
{
assert
(
class_loader
()
==
NULL
,
"Must be"
);
size_t
word_size
=
Metaspace
::
first_chunk_word_size
();
set_metaspace
(
new
Metaspace
(
_metaspace_lock
,
word_size
));
set_metaspace
(
new
Metaspace
(
_metaspace_lock
,
Metaspace
::
BootMetaspaceType
));
}
else
if
(
is_anonymous
())
{
if
(
TraceClassLoaderData
&&
Verbose
&&
class_loader
()
!=
NULL
)
{
tty
->
print_cr
(
"is_anonymous: %s"
,
class_loader
()
->
klass
()
->
internal_name
());
}
set_metaspace
(
new
Metaspace
(
_metaspace_lock
,
Metaspace
::
AnonymousMetaspaceType
));
}
else
if
(
class_loader
()
->
is_a
(
SystemDictionary
::
reflect_DelegatingClassLoader_klass
()))
{
if
(
TraceClassLoaderData
&&
Verbose
&&
class_loader
()
!=
NULL
)
{
tty
->
print_cr
(
"is_reflection: %s"
,
class_loader
()
->
klass
()
->
internal_name
());
}
set_metaspace
(
new
Metaspace
(
_metaspace_lock
,
Metaspace
::
ReflectionMetaspaceType
));
}
else
{
set_metaspace
(
new
Metaspace
(
_metaspace_lock
));
// default size for now.
set_metaspace
(
new
Metaspace
(
_metaspace_lock
,
Metaspace
::
StandardMetaspaceType
));
}
}
return
_metaspace
;
...
...
@@ -672,8 +681,8 @@ void ClassLoaderData::initialize_shared_metaspaces() {
"only supported for null loader data for now"
);
assert
(
!
_shared_metaspaces_initialized
,
"only initialize once"
);
MutexLockerEx
ml
(
metaspace_lock
(),
Mutex
::
_no_safepoint_check_flag
);
_ro_metaspace
=
new
Metaspace
(
_metaspace_lock
,
SharedReadOnlySize
/
wordSiz
e
);
_rw_metaspace
=
new
Metaspace
(
_metaspace_lock
,
SharedReadWriteSize
/
wordSiz
e
);
_ro_metaspace
=
new
Metaspace
(
_metaspace_lock
,
Metaspace
::
ROMetaspaceTyp
e
);
_rw_metaspace
=
new
Metaspace
(
_metaspace_lock
,
Metaspace
::
ReadWriteMetaspaceTyp
e
);
_shared_metaspaces_initialized
=
true
;
}
...
...
src/share/vm/memory/binaryTreeDictionary.cpp
浏览文件 @
0d459bfa
...
...
@@ -67,7 +67,8 @@ void TreeChunk<Chunk_t, FreeList_t>::verify_tree_chunk_list() const {
}
template
<
class
Chunk_t
,
template
<
class
>
class
FreeList_t
>
TreeList
<
Chunk_t
,
FreeList_t
>::
TreeList
()
{}
TreeList
<
Chunk_t
,
FreeList_t
>::
TreeList
()
:
_parent
(
NULL
),
_left
(
NULL
),
_right
(
NULL
)
{}
template
<
class
Chunk_t
,
template
<
class
>
class
FreeList_t
>
TreeList
<
Chunk_t
,
FreeList_t
>*
...
...
@@ -82,7 +83,7 @@ TreeList<Chunk_t, FreeList_t>::as_TreeList(TreeChunk<Chunk_t,FreeList_t>* tc) {
tl
->
link_head
(
tc
);
tl
->
link_tail
(
tc
);
tl
->
set_count
(
1
);
assert
(
tl
->
parent
()
==
NULL
,
"Should be clear"
);
return
tl
;
}
...
...
src/share/vm/memory/collectorPolicy.cpp
浏览文件 @
0d459bfa
...
...
@@ -777,6 +777,15 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation(
full_gc_count
,
GCCause
::
_metadata_GC_threshold
);
VMThread
::
execute
(
&
op
);
// If GC was locked out, try again. Check
// before checking success because the prologue
// could have succeeded and the GC still have
// been locked out.
if
(
op
.
gc_locked
())
{
continue
;
}
if
(
op
.
prologue_succeeded
())
{
return
op
.
result
();
}
...
...
src/share/vm/memory/metachunk.cpp
浏览文件 @
0d459bfa
...
...
@@ -56,6 +56,7 @@ Metachunk* Metachunk::initialize(MetaWord* ptr, size_t word_size) {
assert
(
chunk_end
>
chunk_bottom
,
"Chunk must be too small"
);
chunk
->
set_end
(
chunk_end
);
chunk
->
set_next
(
NULL
);
chunk
->
set_prev
(
NULL
);
chunk
->
set_word_size
(
word_size
);
#ifdef ASSERT
size_t
data_word_size
=
pointer_delta
(
chunk_end
,
chunk_bottom
,
sizeof
(
MetaWord
));
...
...
@@ -76,15 +77,15 @@ MetaWord* Metachunk::allocate(size_t word_size) {
}
// _bottom points to the start of the chunk including the overhead.
size_t
Metachunk
::
used_word_size
()
{
size_t
Metachunk
::
used_word_size
()
const
{
return
pointer_delta
(
_top
,
_bottom
,
sizeof
(
MetaWord
));
}
size_t
Metachunk
::
free_word_size
()
{
size_t
Metachunk
::
free_word_size
()
const
{
return
pointer_delta
(
_end
,
_top
,
sizeof
(
MetaWord
));
}
size_t
Metachunk
::
capacity_word_size
()
{
size_t
Metachunk
::
capacity_word_size
()
const
{
return
pointer_delta
(
_end
,
_bottom
,
sizeof
(
MetaWord
));
}
...
...
@@ -93,6 +94,10 @@ void Metachunk::print_on(outputStream* st) const {
" bottom "
PTR_FORMAT
" top "
PTR_FORMAT
" end "
PTR_FORMAT
" size "
SIZE_FORMAT
,
bottom
(),
top
(),
end
(),
word_size
());
if
(
Verbose
)
{
st
->
print_cr
(
" used "
SIZE_FORMAT
" free "
SIZE_FORMAT
,
used_word_size
(),
free_word_size
());
}
}
#ifndef PRODUCT
...
...
src/share/vm/memory/metachunk.hpp
浏览文件 @
0d459bfa
...
...
@@ -67,9 +67,11 @@ class Metachunk VALUE_OBJ_CLASS_SPEC {
void
set_word_size
(
size_t
v
)
{
_word_size
=
v
;
}
public:
#ifdef ASSERT
Metachunk
()
:
_bottom
(
NULL
),
_end
(
NULL
),
_top
(
NULL
),
_is_free
(
false
)
{}
Metachunk
()
:
_bottom
(
NULL
),
_end
(
NULL
),
_top
(
NULL
),
_is_free
(
false
),
_next
(
NULL
),
_prev
(
NULL
)
{}
#else
Metachunk
()
:
_bottom
(
NULL
),
_end
(
NULL
),
_top
(
NULL
)
{}
Metachunk
()
:
_bottom
(
NULL
),
_end
(
NULL
),
_top
(
NULL
),
_next
(
NULL
),
_prev
(
NULL
)
{}
#endif
// Used to add a Metachunk to a list of Metachunks
...
...
@@ -102,15 +104,15 @@ class Metachunk VALUE_OBJ_CLASS_SPEC {
}
// Reset top to bottom so chunk can be reused.
void
reset_empty
()
{
_top
=
(
_bottom
+
_overhead
);
}
void
reset_empty
()
{
_top
=
(
_bottom
+
_overhead
);
_next
=
NULL
;
_prev
=
NULL
;
}
bool
is_empty
()
{
return
_top
==
(
_bottom
+
_overhead
);
}
// used (has been allocated)
// free (available for future allocations)
// capacity (total size of chunk)
size_t
used_word_size
();
size_t
free_word_size
();
size_t
capacity_word_size
();
size_t
used_word_size
()
const
;
size_t
free_word_size
()
const
;
size_t
capacity_word_size
()
const
;
// Debug support
#ifdef ASSERT
...
...
src/share/vm/memory/metaspace.cpp
浏览文件 @
0d459bfa
此差异已折叠。
点击以展开。
src/share/vm/memory/metaspace.hpp
浏览文件 @
0d459bfa
...
...
@@ -87,11 +87,23 @@ class Metaspace : public CHeapObj<mtClass> {
public:
enum
MetadataType
{
ClassType
,
NonClassType
};
enum
MetaspaceType
{
StandardMetaspaceType
,
BootMetaspaceType
,
ROMetaspaceType
,
ReadWriteMetaspaceType
,
AnonymousMetaspaceType
,
ReflectionMetaspaceType
};
private:
void
initialize
(
Mutex
*
lock
,
size_t
initial_size
=
0
);
void
initialize
(
Mutex
*
lock
,
MetaspaceType
type
);
// Align up the word size to the allocation word size
static
size_t
align_word_size_up
(
size_t
);
static
size_t
_first_chunk_word_size
;
static
size_t
_first_class_chunk_word_size
;
SpaceManager
*
_vsm
;
SpaceManager
*
vsm
()
const
{
return
_vsm
;
}
...
...
@@ -110,8 +122,7 @@ class Metaspace : public CHeapObj<mtClass> {
public:
Metaspace
(
Mutex
*
lock
,
size_t
initial_size
);
Metaspace
(
Mutex
*
lock
);
Metaspace
(
Mutex
*
lock
,
MetaspaceType
type
);
~
Metaspace
();
// Initialize globals for Metaspace
...
...
@@ -119,6 +130,7 @@ class Metaspace : public CHeapObj<mtClass> {
static
void
initialize_class_space
(
ReservedSpace
rs
);
static
size_t
first_chunk_word_size
()
{
return
_first_chunk_word_size
;
}
static
size_t
first_class_chunk_word_size
()
{
return
_first_class_chunk_word_size
;
}
char
*
bottom
()
const
;
size_t
used_words
(
MetadataType
mdtype
)
const
;
...
...
src/share/vm/runtime/globals.hpp
浏览文件 @
0d459bfa
...
...
@@ -2217,7 +2217,8 @@ class CommandLineFlags {
develop(bool, TraceClassLoaderData, false, \
"Trace class loader loader_data lifetime") \
\
product(uintx, InitialBootClassLoaderMetaspaceSize, 3*M, \
product(uintx, InitialBootClassLoaderMetaspaceSize, \
NOT_LP64(2200*K) LP64_ONLY(4*M), \
"Initial size of the boot class loader data metaspace") \
\
product(bool, TraceGen0Time, false, \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录