Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
19c54e8a
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看板
提交
19c54e8a
编写于
8月 30, 2010
作者:
T
tonyp
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
4f0e4610
8f5371a9
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
47 addition
and
61 deletion
+47
-61
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
...ion/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
+17
-3
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+2
-2
src/share/vm/services/g1MemoryPool.cpp
src/share/vm/services/g1MemoryPool.cpp
+4
-36
src/share/vm/services/g1MemoryPool.hpp
src/share/vm/services/g1MemoryPool.hpp
+18
-15
src/share/vm/services/management.cpp
src/share/vm/services/management.cpp
+5
-4
test/gc/6581734/Test6581734.java
test/gc/6581734/Test6581734.java
+1
-1
未找到文件。
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
浏览文件 @
19c54e8a
...
...
@@ -252,12 +252,13 @@ class ModUnionClosurePar: public ModUnionClosure {
class
ChunkArray
:
public
CHeapObj
{
size_t
_index
;
size_t
_capacity
;
size_t
_overflows
;
HeapWord
**
_array
;
// storage for array
public:
ChunkArray
()
:
_index
(
0
),
_capacity
(
0
),
_array
(
NULL
)
{}
ChunkArray
()
:
_index
(
0
),
_capacity
(
0
),
_
overflows
(
0
),
_
array
(
NULL
)
{}
ChunkArray
(
HeapWord
**
a
,
size_t
c
)
:
_index
(
0
),
_capacity
(
c
),
_array
(
a
)
{}
_index
(
0
),
_capacity
(
c
),
_
overflows
(
0
),
_
array
(
a
)
{}
HeapWord
**
array
()
{
return
_array
;
}
void
set_array
(
HeapWord
**
a
)
{
_array
=
a
;
}
...
...
@@ -266,7 +267,9 @@ class ChunkArray: public CHeapObj {
void
set_capacity
(
size_t
c
)
{
_capacity
=
c
;
}
size_t
end
()
{
assert
(
_index
<
capacity
(),
"_index out of bounds"
);
assert
(
_index
<=
capacity
(),
err_msg
(
"_index ("
SIZE_FORMAT
") > _capacity ("
SIZE_FORMAT
"): out of bounds"
,
_index
,
_capacity
));
return
_index
;
}
// exclusive
...
...
@@ -277,12 +280,23 @@ class ChunkArray: public CHeapObj {
void
reset
()
{
_index
=
0
;
if
(
_overflows
>
0
&&
PrintCMSStatistics
>
1
)
{
warning
(
"CMS: ChunkArray["
SIZE_FORMAT
"] overflowed "
SIZE_FORMAT
" times"
,
_capacity
,
_overflows
);
}
_overflows
=
0
;
}
void
record_sample
(
HeapWord
*
p
,
size_t
sz
)
{
// For now we do not do anything with the size
if
(
_index
<
_capacity
)
{
_array
[
_index
++
]
=
p
;
}
else
{
++
_overflows
;
assert
(
_index
==
_capacity
,
err_msg
(
"_index ("
SIZE_FORMAT
") > _capacity ("
SIZE_FORMAT
"): out of bounds at overflow#"
SIZE_FORMAT
,
_index
,
_capacity
,
_overflows
));
}
}
};
...
...
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
浏览文件 @
19c54e8a
...
...
@@ -2753,7 +2753,7 @@ void G1CollectedHeap::print_taskqueue_stats(outputStream* const st) const {
print_taskqueue_stats_hdr
(
st
);
TaskQueueStats
totals
;
const
int
n
=
MAX2
(
workers
()
->
total_workers
(),
1
)
;
const
int
n
=
workers
()
!=
NULL
?
workers
()
->
total_workers
()
:
1
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
{
st
->
print
(
"%3d "
,
i
);
task_queue
(
i
)
->
stats
.
print
(
st
);
st
->
cr
();
totals
+=
task_queue
(
i
)
->
stats
;
...
...
@@ -2764,7 +2764,7 @@ void G1CollectedHeap::print_taskqueue_stats(outputStream* const st) const {
}
void
G1CollectedHeap
::
reset_taskqueue_stats
()
{
const
int
n
=
MAX2
(
workers
()
->
total_workers
(),
1
)
;
const
int
n
=
workers
()
!=
NULL
?
workers
()
->
total_workers
()
:
1
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
{
task_queue
(
i
)
->
stats
.
reset
();
}
...
...
src/share/vm/services/g1MemoryPool.cpp
浏览文件 @
19c54e8a
...
...
@@ -28,12 +28,11 @@
G1MemoryPoolSuper
::
G1MemoryPoolSuper
(
G1CollectedHeap
*
g1h
,
const
char
*
name
,
size_t
init_size
,
size_t
max_size
,
bool
support_usage_threshold
)
:
_g1h
(
g1h
),
CollectedMemoryPool
(
name
,
MemoryPool
::
Heap
,
init_size
,
max_size
,
undefined_max
()
,
support_usage_threshold
)
{
assert
(
UseG1GC
,
"sanity"
);
}
...
...
@@ -52,13 +51,6 @@ size_t G1MemoryPoolSuper::eden_space_used(G1CollectedHeap* g1h) {
return
eden_used
;
}
// See the comment at the top of g1MemoryPool.hpp
size_t
G1MemoryPoolSuper
::
eden_space_max
(
G1CollectedHeap
*
g1h
)
{
// This should ensure that it returns a value no smaller than the
// region size. Currently, eden_space_committed() guarantees that.
return
eden_space_committed
(
g1h
);
}
// See the comment at the top of g1MemoryPool.hpp
size_t
G1MemoryPoolSuper
::
survivor_space_committed
(
G1CollectedHeap
*
g1h
)
{
return
MAX2
(
survivor_space_used
(
g1h
),
(
size_t
)
HeapRegion
::
GrainBytes
);
...
...
@@ -71,13 +63,6 @@ size_t G1MemoryPoolSuper::survivor_space_used(G1CollectedHeap* g1h) {
return
survivor_used
;
}
// See the comment at the top of g1MemoryPool.hpp
size_t
G1MemoryPoolSuper
::
survivor_space_max
(
G1CollectedHeap
*
g1h
)
{
// This should ensure that it returns a value no smaller than the
// region size. Currently, survivor_space_committed() guarantees that.
return
survivor_space_committed
(
g1h
);
}
// See the comment at the top of g1MemoryPool.hpp
size_t
G1MemoryPoolSuper
::
old_space_committed
(
G1CollectedHeap
*
g1h
)
{
size_t
committed
=
overall_committed
(
g1h
);
...
...
@@ -99,24 +84,11 @@ size_t G1MemoryPoolSuper::old_space_used(G1CollectedHeap* g1h) {
return
used
;
}
// See the comment at the top of g1MemoryPool.hpp
size_t
G1MemoryPoolSuper
::
old_space_max
(
G1CollectedHeap
*
g1h
)
{
size_t
max
=
overall_max
(
g1h
);
size_t
eden_max
=
eden_space_max
(
g1h
);
size_t
survivor_max
=
survivor_space_max
(
g1h
);
max
=
subtract_up_to_zero
(
max
,
eden_max
);
max
=
subtract_up_to_zero
(
max
,
survivor_max
);
max
=
MAX2
(
max
,
(
size_t
)
HeapRegion
::
GrainBytes
);
return
max
;
}
G1EdenPool
::
G1EdenPool
(
G1CollectedHeap
*
g1h
)
:
G1MemoryPoolSuper
(
g1h
,
"G1 Eden"
,
eden_space_committed
(
g1h
),
/* init_size */
eden_space_max
(
g1h
),
/* max_size */
false
/* support_usage_threshold */
)
{
}
false
/* support_usage_threshold */
)
{
}
MemoryUsage
G1EdenPool
::
get_memory_usage
()
{
size_t
initial_sz
=
initial_size
();
...
...
@@ -131,9 +103,7 @@ G1SurvivorPool::G1SurvivorPool(G1CollectedHeap* g1h) :
G1MemoryPoolSuper
(
g1h
,
"G1 Survivor"
,
survivor_space_committed
(
g1h
),
/* init_size */
survivor_space_max
(
g1h
),
/* max_size */
false
/* support_usage_threshold */
)
{
}
false
/* support_usage_threshold */
)
{
}
MemoryUsage
G1SurvivorPool
::
get_memory_usage
()
{
size_t
initial_sz
=
initial_size
();
...
...
@@ -148,9 +118,7 @@ G1OldGenPool::G1OldGenPool(G1CollectedHeap* g1h) :
G1MemoryPoolSuper
(
g1h
,
"G1 Old Gen"
,
old_space_committed
(
g1h
),
/* init_size */
old_space_max
(
g1h
),
/* max_size */
true
/* support_usage_threshold */
)
{
}
true
/* support_usage_threshold */
)
{
}
MemoryUsage
G1OldGenPool
::
get_memory_usage
()
{
size_t
initial_sz
=
initial_size
();
...
...
src/share/vm/services/g1MemoryPool.hpp
浏览文件 @
19c54e8a
...
...
@@ -74,14 +74,20 @@ class G1CollectedHeap;
// in the future.
//
// 3) Another decision that is again not straightforward is what is
// the max size that each memory pool can grow to.
Right now, we set
//
that the committed size for the eden and the survivors
and
//
calculate the old gen max as follows (basically, it's a similar
//
pattern to what we use for the committed space, as described
// above):
// the max size that each memory pool can grow to.
One way to do this
//
would be to use the committed size for the max for the eden
and
//
survivors and calculate the old gen max as follows (basically, it's
//
a similar pattern to what we use for the committed space, as
//
described
above):
//
// old_gen_max = overall_max - eden_max - survivor_max
//
// Unfortunately, the above makes the max of each pool fluctuate over
// time and, even though this is allowed according to the spec, it
// broke several assumptions in the M&M framework (there were cases
// where used would reach a value greater than max). So, for max we
// use -1, which means "undefined" according to the spec.
//
// 4) Now, there is a very subtle issue with all the above. The
// framework will call get_memory_usage() on the three pools
// asynchronously. As a result, each call might get a different value
...
...
@@ -125,33 +131,30 @@ protected:
G1MemoryPoolSuper
(
G1CollectedHeap
*
g1h
,
const
char
*
name
,
size_t
init_size
,
size_t
max_size
,
bool
support_usage_threshold
);
// The reason why all the code is in static methods is so that it
// can be safely called from the constructors of the subclasses.
static
size_t
undefined_max
()
{
return
(
size_t
)
-
1
;
}
static
size_t
overall_committed
(
G1CollectedHeap
*
g1h
)
{
return
g1h
->
capacity
();
}
static
size_t
overall_used
(
G1CollectedHeap
*
g1h
)
{
return
g1h
->
used_unlocked
();
}
static
size_t
overall_max
(
G1CollectedHeap
*
g1h
)
{
return
g1h
->
g1_reserved_obj_bytes
();
}
static
size_t
eden_space_committed
(
G1CollectedHeap
*
g1h
);
static
size_t
eden_space_used
(
G1CollectedHeap
*
g1h
);
static
size_t
eden_space_max
(
G1CollectedHeap
*
g1h
);
static
size_t
survivor_space_committed
(
G1CollectedHeap
*
g1h
);
static
size_t
survivor_space_used
(
G1CollectedHeap
*
g1h
);
static
size_t
survivor_space_max
(
G1CollectedHeap
*
g1h
);
static
size_t
old_space_committed
(
G1CollectedHeap
*
g1h
);
static
size_t
old_space_used
(
G1CollectedHeap
*
g1h
);
static
size_t
old_space_max
(
G1CollectedHeap
*
g1h
);
};
// Memory pool that represents the G1 eden.
...
...
@@ -163,7 +166,7 @@ public:
return
eden_space_used
(
_g1h
);
}
size_t
max_size
()
const
{
return
eden_space_max
(
_g1h
);
return
undefined_max
(
);
}
MemoryUsage
get_memory_usage
();
};
...
...
@@ -177,7 +180,7 @@ public:
return
survivor_space_used
(
_g1h
);
}
size_t
max_size
()
const
{
return
survivor_space_max
(
_g1h
);
return
undefined_max
(
);
}
MemoryUsage
get_memory_usage
();
};
...
...
@@ -191,7 +194,7 @@ public:
return
old_space_used
(
_g1h
);
}
size_t
max_size
()
const
{
return
old_space_max
(
_g1h
);
return
undefined_max
(
);
}
MemoryUsage
get_memory_usage
();
};
src/share/vm/services/management.cpp
浏览文件 @
19c54e8a
...
...
@@ -785,10 +785,11 @@ JVM_ENTRY(jobject, jmm_GetMemoryUsage(JNIEnv* env, jboolean heap))
}
}
// In our current implementation, all pools should have
// defined init and max size
assert
(
!
has_undefined_init_size
,
"Undefined init size"
);
assert
(
!
has_undefined_max_size
,
"Undefined max size"
);
// In our current implementation, we make sure that all non-heap
// pools have defined init and max sizes. Heap pools do not matter,
// as we never use total_init and total_max for them.
assert
(
heap
||
!
has_undefined_init_size
,
"Undefined init size"
);
assert
(
heap
||
!
has_undefined_max_size
,
"Undefined max size"
);
MemoryUsage
usage
((
heap
?
InitialHeapSize
:
total_init
),
total_used
,
...
...
test/gc/6581734/Test6581734.java
浏览文件 @
19c54e8a
...
...
@@ -121,7 +121,7 @@ public class Test6581734 {
}
if
(
collectorsWithTime
<
collectorsFound
)
{
throw
new
RuntimeException
(
"collectors found with zero time"
;
throw
new
RuntimeException
(
"collectors found with zero time"
)
;
}
System
.
out
.
println
(
"Test passed."
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录