Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
2172dd9d
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看板
提交
2172dd9d
编写于
4月 11, 2014
作者:
P
pliden
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8037112: gc/g1/TestHumongousAllocInitialMark.java caused SIGSEGV
Reviewed-by: brutisso, mgerdin
上级
d74a10db
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
89 addition
and
10 deletion
+89
-10
src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp
src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp
+25
-8
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+13
-0
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
+2
-0
src/share/vm/gc_implementation/g1/g1StringDedup.cpp
src/share/vm/gc_implementation/g1/g1StringDedup.cpp
+5
-0
src/share/vm/gc_implementation/g1/g1StringDedup.hpp
src/share/vm/gc_implementation/g1/g1StringDedup.hpp
+4
-0
src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp
src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp
+8
-1
src/share/vm/gc_implementation/g1/g1StringDedupQueue.hpp
src/share/vm/gc_implementation/g1/g1StringDedupQueue.hpp
+4
-0
src/share/vm/gc_implementation/g1/g1StringDedupThread.cpp
src/share/vm/gc_implementation/g1/g1StringDedupThread.cpp
+20
-1
src/share/vm/gc_implementation/g1/g1StringDedupThread.hpp
src/share/vm/gc_implementation/g1/g1StringDedupThread.hpp
+2
-0
src/share/vm/gc_interface/collectedHeap.hpp
src/share/vm/gc_interface/collectedHeap.hpp
+3
-0
src/share/vm/runtime/java.cpp
src/share/vm/runtime/java.cpp
+3
-0
未找到文件。
src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp
浏览文件 @
2172dd9d
...
@@ -89,6 +89,10 @@ void ConcurrentMarkThread::run() {
...
@@ -89,6 +89,10 @@ void ConcurrentMarkThread::run() {
while
(
!
_should_terminate
)
{
while
(
!
_should_terminate
)
{
// wait until started is set.
// wait until started is set.
sleepBeforeNextCycle
();
sleepBeforeNextCycle
();
if
(
_should_terminate
)
{
break
;
}
{
{
ResourceMark
rm
;
ResourceMark
rm
;
HandleMark
hm
;
HandleMark
hm
;
...
@@ -303,11 +307,21 @@ void ConcurrentMarkThread::yield() {
...
@@ -303,11 +307,21 @@ void ConcurrentMarkThread::yield() {
}
}
void
ConcurrentMarkThread
::
stop
()
{
void
ConcurrentMarkThread
::
stop
()
{
// it is ok to take late safepoints here, if needed
{
MutexLockerEx
mu
(
Terminator_lock
);
MutexLockerEx
ml
(
Terminator_lock
);
_should_terminate
=
true
;
_should_terminate
=
true
;
while
(
!
_has_terminated
)
{
}
Terminator_lock
->
wait
();
{
MutexLockerEx
ml
(
CGC_lock
,
Mutex
::
_no_safepoint_check_flag
);
CGC_lock
->
notify_all
();
}
{
MutexLockerEx
ml
(
Terminator_lock
);
while
(
!
_has_terminated
)
{
Terminator_lock
->
wait
();
}
}
}
}
}
...
@@ -327,11 +341,14 @@ void ConcurrentMarkThread::sleepBeforeNextCycle() {
...
@@ -327,11 +341,14 @@ void ConcurrentMarkThread::sleepBeforeNextCycle() {
assert
(
!
in_progress
(),
"should have been cleared"
);
assert
(
!
in_progress
(),
"should have been cleared"
);
MutexLockerEx
x
(
CGC_lock
,
Mutex
::
_no_safepoint_check_flag
);
MutexLockerEx
x
(
CGC_lock
,
Mutex
::
_no_safepoint_check_flag
);
while
(
!
started
())
{
while
(
!
started
()
&&
!
_should_terminate
)
{
CGC_lock
->
wait
(
Mutex
::
_no_safepoint_check_flag
);
CGC_lock
->
wait
(
Mutex
::
_no_safepoint_check_flag
);
}
}
set_in_progress
();
clear_started
();
if
(
started
())
{
set_in_progress
();
clear_started
();
}
}
}
// Note: As is the case with CMS - this method, although exported
// Note: As is the case with CMS - this method, although exported
...
...
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
浏览文件 @
2172dd9d
...
@@ -435,6 +435,9 @@ HeapRegion* G1CollectedHeap::pop_dirty_cards_region()
...
@@ -435,6 +435,9 @@ HeapRegion* G1CollectedHeap::pop_dirty_cards_region()
void
G1CollectedHeap
::
stop_conc_gc_threads
()
{
void
G1CollectedHeap
::
stop_conc_gc_threads
()
{
_cg1r
->
stop
();
_cg1r
->
stop
();
_cmThread
->
stop
();
_cmThread
->
stop
();
if
(
G1StringDedup
::
is_enabled
())
{
G1StringDedup
::
stop
();
}
}
}
#ifdef ASSERT
#ifdef ASSERT
...
@@ -2182,6 +2185,16 @@ jint G1CollectedHeap::initialize() {
...
@@ -2182,6 +2185,16 @@ jint G1CollectedHeap::initialize() {
return
JNI_OK
;
return
JNI_OK
;
}
}
void
G1CollectedHeap
::
stop
()
{
// Abort any ongoing concurrent root region scanning and stop all
// concurrent threads. We do this to make sure these threads do
// not continue to execute and access resources (e.g. gclog_or_tty)
// that are destroyed during shutdown.
_cm
->
root_regions
()
->
abort
();
_cm
->
root_regions
()
->
wait_until_scan_finished
();
stop_conc_gc_threads
();
}
size_t
G1CollectedHeap
::
conservative_max_heap_alignment
()
{
size_t
G1CollectedHeap
::
conservative_max_heap_alignment
()
{
return
HeapRegion
::
max_region_size
();
return
HeapRegion
::
max_region_size
();
}
}
...
...
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
浏览文件 @
2172dd9d
...
@@ -1082,6 +1082,8 @@ public:
...
@@ -1082,6 +1082,8 @@ public:
// specified by the policy object.
// specified by the policy object.
jint
initialize
();
jint
initialize
();
virtual
void
stop
();
// Return the (conservative) maximum heap alignment for any G1 heap
// Return the (conservative) maximum heap alignment for any G1 heap
static
size_t
conservative_max_heap_alignment
();
static
size_t
conservative_max_heap_alignment
();
...
...
src/share/vm/gc_implementation/g1/g1StringDedup.cpp
浏览文件 @
2172dd9d
...
@@ -44,6 +44,11 @@ void G1StringDedup::initialize() {
...
@@ -44,6 +44,11 @@ void G1StringDedup::initialize() {
}
}
}
}
void
G1StringDedup
::
stop
()
{
assert
(
is_enabled
(),
"String deduplication not enabled"
);
G1StringDedupThread
::
stop
();
}
bool
G1StringDedup
::
is_candidate_from_mark
(
oop
obj
)
{
bool
G1StringDedup
::
is_candidate_from_mark
(
oop
obj
)
{
if
(
java_lang_String
::
is_instance
(
obj
))
{
if
(
java_lang_String
::
is_instance
(
obj
))
{
bool
from_young
=
G1CollectedHeap
::
heap
()
->
heap_region_containing_raw
(
obj
)
->
is_young
();
bool
from_young
=
G1CollectedHeap
::
heap
()
->
heap_region_containing_raw
(
obj
)
->
is_young
();
...
...
src/share/vm/gc_implementation/g1/g1StringDedup.hpp
浏览文件 @
2172dd9d
...
@@ -110,8 +110,12 @@ public:
...
@@ -110,8 +110,12 @@ public:
return
_enabled
;
return
_enabled
;
}
}
// Initialize string deduplication.
static
void
initialize
();
static
void
initialize
();
// Stop the deduplication thread.
static
void
stop
();
// Immediately deduplicates the given String object, bypassing the
// Immediately deduplicates the given String object, bypassing the
// the deduplication queue.
// the deduplication queue.
static
void
deduplicate
(
oop
java_string
);
static
void
deduplicate
(
oop
java_string
);
...
...
src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp
浏览文件 @
2172dd9d
...
@@ -35,6 +35,7 @@ const size_t G1StringDedupQueue::_max_cache_size = 0; // Max cache size p
...
@@ -35,6 +35,7 @@ const size_t G1StringDedupQueue::_max_cache_size = 0; // Max cache size p
G1StringDedupQueue
::
G1StringDedupQueue
()
:
G1StringDedupQueue
::
G1StringDedupQueue
()
:
_cursor
(
0
),
_cursor
(
0
),
_cancel
(
false
),
_empty
(
true
),
_empty
(
true
),
_dropped
(
0
)
{
_dropped
(
0
)
{
_nqueues
=
MAX2
(
ParallelGCThreads
,
(
size_t
)
1
);
_nqueues
=
MAX2
(
ParallelGCThreads
,
(
size_t
)
1
);
...
@@ -55,11 +56,17 @@ void G1StringDedupQueue::create() {
...
@@ -55,11 +56,17 @@ void G1StringDedupQueue::create() {
void
G1StringDedupQueue
::
wait
()
{
void
G1StringDedupQueue
::
wait
()
{
MonitorLockerEx
ml
(
StringDedupQueue_lock
,
Mutex
::
_no_safepoint_check_flag
);
MonitorLockerEx
ml
(
StringDedupQueue_lock
,
Mutex
::
_no_safepoint_check_flag
);
while
(
_queue
->
_empty
)
{
while
(
_queue
->
_empty
&&
!
_queue
->
_cancel
)
{
ml
.
wait
(
Mutex
::
_no_safepoint_check_flag
);
ml
.
wait
(
Mutex
::
_no_safepoint_check_flag
);
}
}
}
}
void
G1StringDedupQueue
::
cancel_wait
()
{
MonitorLockerEx
ml
(
StringDedupQueue_lock
,
Mutex
::
_no_safepoint_check_flag
);
_queue
->
_cancel
=
true
;
ml
.
notify
();
}
void
G1StringDedupQueue
::
push
(
uint
worker_id
,
oop
java_string
)
{
void
G1StringDedupQueue
::
push
(
uint
worker_id
,
oop
java_string
)
{
assert
(
SafepointSynchronize
::
is_at_safepoint
(),
"Must be at safepoint"
);
assert
(
SafepointSynchronize
::
is_at_safepoint
(),
"Must be at safepoint"
);
assert
(
worker_id
<
_queue
->
_nqueues
,
"Invalid queue"
);
assert
(
worker_id
<
_queue
->
_nqueues
,
"Invalid queue"
);
...
...
src/share/vm/gc_implementation/g1/g1StringDedupQueue.hpp
浏览文件 @
2172dd9d
...
@@ -65,6 +65,7 @@ private:
...
@@ -65,6 +65,7 @@ private:
G1StringDedupWorkerQueue
*
_queues
;
G1StringDedupWorkerQueue
*
_queues
;
size_t
_nqueues
;
size_t
_nqueues
;
size_t
_cursor
;
size_t
_cursor
;
bool
_cancel
;
volatile
bool
_empty
;
volatile
bool
_empty
;
// Statistics counter, only used for logging.
// Statistics counter, only used for logging.
...
@@ -81,6 +82,9 @@ public:
...
@@ -81,6 +82,9 @@ public:
// Blocks and waits for the queue to become non-empty.
// Blocks and waits for the queue to become non-empty.
static
void
wait
();
static
void
wait
();
// Wakes up any thread blocked waiting for the queue to become non-empty.
static
void
cancel_wait
();
// Pushes a deduplication candidate onto a specific GC worker queue.
// Pushes a deduplication candidate onto a specific GC worker queue.
static
void
push
(
uint
worker_id
,
oop
java_string
);
static
void
push
(
uint
worker_id
,
oop
java_string
);
...
...
src/share/vm/gc_implementation/g1/g1StringDedupThread.cpp
浏览文件 @
2172dd9d
...
@@ -73,6 +73,9 @@ void G1StringDedupThread::run() {
...
@@ -73,6 +73,9 @@ void G1StringDedupThread::run() {
// Wait for the queue to become non-empty
// Wait for the queue to become non-empty
G1StringDedupQueue
::
wait
();
G1StringDedupQueue
::
wait
();
if
(
_should_terminate
)
{
break
;
}
// Include this thread in safepoints
// Include this thread in safepoints
stsJoin
();
stsJoin
();
...
@@ -108,7 +111,23 @@ void G1StringDedupThread::run() {
...
@@ -108,7 +111,23 @@ void G1StringDedupThread::run() {
stsLeave
();
stsLeave
();
}
}
ShouldNotReachHere
();
terminate
();
}
void
G1StringDedupThread
::
stop
()
{
{
MonitorLockerEx
ml
(
Terminator_lock
);
_thread
->
_should_terminate
=
true
;
}
G1StringDedupQueue
::
cancel_wait
();
{
MonitorLockerEx
ml
(
Terminator_lock
);
while
(
!
_thread
->
_has_terminated
)
{
ml
.
wait
();
}
}
}
}
void
G1StringDedupThread
::
print
(
outputStream
*
st
,
const
G1StringDedupStat
&
last_stat
,
const
G1StringDedupStat
&
total_stat
)
{
void
G1StringDedupThread
::
print
(
outputStream
*
st
,
const
G1StringDedupStat
&
last_stat
,
const
G1StringDedupStat
&
total_stat
)
{
...
...
src/share/vm/gc_implementation/g1/g1StringDedupThread.hpp
浏览文件 @
2172dd9d
...
@@ -47,6 +47,8 @@ private:
...
@@ -47,6 +47,8 @@ private:
public:
public:
static
void
create
();
static
void
create
();
static
void
stop
();
static
G1StringDedupThread
*
thread
();
static
G1StringDedupThread
*
thread
();
virtual
void
run
();
virtual
void
run
();
...
...
src/share/vm/gc_interface/collectedHeap.hpp
浏览文件 @
2172dd9d
...
@@ -208,6 +208,9 @@ class CollectedHeap : public CHeapObj<mtInternal> {
...
@@ -208,6 +208,9 @@ class CollectedHeap : public CHeapObj<mtInternal> {
// This is the correct place to place such initialization methods.
// This is the correct place to place such initialization methods.
virtual
void
post_initialize
()
=
0
;
virtual
void
post_initialize
()
=
0
;
// Stop any onging concurrent work and prepare for exit.
virtual
void
stop
()
{}
MemRegion
reserved_region
()
const
{
return
_reserved
;
}
MemRegion
reserved_region
()
const
{
return
_reserved
;
}
address
base
()
const
{
return
(
address
)
reserved_region
().
start
();
}
address
base
()
const
{
return
(
address
)
reserved_region
().
start
();
}
...
...
src/share/vm/runtime/java.cpp
浏览文件 @
2172dd9d
...
@@ -497,6 +497,9 @@ void before_exit(JavaThread * thread) {
...
@@ -497,6 +497,9 @@ void before_exit(JavaThread * thread) {
os
::
infinite_sleep
();
os
::
infinite_sleep
();
}
}
// Stop any ongoing concurrent GC work
Universe
::
heap
()
->
stop
();
// Terminate watcher thread - must before disenrolling any periodic task
// Terminate watcher thread - must before disenrolling any periodic task
if
(
PeriodicTask
::
num_tasks
()
>
0
)
if
(
PeriodicTask
::
num_tasks
()
>
0
)
WatcherThread
::
stop
();
WatcherThread
::
stop
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录