Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
cc25b2cd
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cc25b2cd
编写于
9月 11, 2013
作者:
M
mgerdin
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
91e4f7e3
077a92c4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
3 deletion
+32
-3
src/share/vm/memory/metaspace.cpp
src/share/vm/memory/metaspace.cpp
+32
-3
未找到文件。
src/share/vm/memory/metaspace.cpp
浏览文件 @
cc25b2cd
...
...
@@ -51,7 +51,7 @@ const bool metaspace_slow_verify = false;
// Parameters for stress mode testing
const
uint
metadata_deallocate_a_lot_block
=
10
;
const
uint
metadata_deallocate_a_lock_chunk
=
3
;
size_t
const
allocation_from_dictionary_limit
=
6
4
*
K
;
size_t
const
allocation_from_dictionary_limit
=
4
*
K
;
MetaWord
*
last_allocated
=
0
;
...
...
@@ -228,6 +228,10 @@ class BlockFreelist VALUE_OBJ_CLASS_SPEC {
BlockTreeDictionary
*
_dictionary
;
static
Metablock
*
initialize_free_chunk
(
MetaWord
*
p
,
size_t
word_size
);
// Only allocate and split from freelist if the size of the allocation
// is at least 1/4th the size of the available block.
const
static
int
WasteMultiplier
=
4
;
// Accessors
BlockTreeDictionary
*
dictionary
()
const
{
return
_dictionary
;
}
...
...
@@ -623,6 +627,7 @@ class SpaceManager : public CHeapObj<mtClass> {
// Add chunk to the list of chunks in use
void
add_chunk
(
Metachunk
*
v
,
bool
make_current
);
void
retire_current_chunk
();
Mutex
*
lock
()
const
{
return
_lock
;
}
...
...
@@ -807,12 +812,25 @@ MetaWord* BlockFreelist::get_block(size_t word_size) {
}
Metablock
*
free_block
=
dictionary
()
->
get_chunk
(
word_size
,
FreeBlockDictionary
<
Metablock
>::
exactly
);
dictionary
()
->
get_chunk
(
word_size
,
FreeBlockDictionary
<
Metablock
>::
atLeast
);
if
(
free_block
==
NULL
)
{
return
NULL
;
}
return
(
MetaWord
*
)
free_block
;
const
size_t
block_size
=
free_block
->
size
();
if
(
block_size
>
WasteMultiplier
*
word_size
)
{
return_block
((
MetaWord
*
)
free_block
,
block_size
);
return
NULL
;
}
MetaWord
*
new_block
=
(
MetaWord
*
)
free_block
;
assert
(
block_size
>=
word_size
,
"Incorrect size of block from freelist"
);
const
size_t
unused
=
block_size
-
word_size
;
if
(
unused
>=
TreeChunk
<
Metablock
,
FreeList
>::
min_size
())
{
return_block
(
new_block
+
word_size
,
unused
);
}
return
new_block
;
}
void
BlockFreelist
::
print_on
(
outputStream
*
st
)
const
{
...
...
@@ -2278,6 +2296,7 @@ void SpaceManager::add_chunk(Metachunk* new_chunk, bool make_current) {
ChunkIndex
index
=
ChunkManager
::
list_index
(
new_chunk
->
word_size
());
if
(
index
!=
HumongousIndex
)
{
retire_current_chunk
();
set_current_chunk
(
new_chunk
);
new_chunk
->
set_next
(
chunks_in_use
(
index
));
set_chunks_in_use
(
index
,
new_chunk
);
...
...
@@ -2313,6 +2332,16 @@ void SpaceManager::add_chunk(Metachunk* new_chunk, bool make_current) {
}
}
void
SpaceManager
::
retire_current_chunk
()
{
if
(
current_chunk
()
!=
NULL
)
{
size_t
remaining_words
=
current_chunk
()
->
free_word_size
();
if
(
remaining_words
>=
TreeChunk
<
Metablock
,
FreeList
>::
min_size
())
{
block_freelists
()
->
return_block
(
current_chunk
()
->
allocate
(
remaining_words
),
remaining_words
);
inc_used_metrics
(
remaining_words
);
}
}
}
Metachunk
*
SpaceManager
::
get_new_chunk
(
size_t
word_size
,
size_t
grow_chunks_by_words
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录