Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
fe6b88ab
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fe6b88ab
编写于
11月 28, 2014
作者:
T
tschatzl
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
8e60f64a
d14febca
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
82 addition
and
10 deletion
+82
-10
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
...pot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+1
-0
hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp
...ot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp
+2
-6
hotspot/src/share/vm/gc_interface/gcCause.cpp
hotspot/src/share/vm/gc_interface/gcCause.cpp
+3
-0
hotspot/src/share/vm/gc_interface/gcCause.hpp
hotspot/src/share/vm/gc_interface/gcCause.hpp
+1
-0
hotspot/src/share/vm/prims/whitebox.cpp
hotspot/src/share/vm/prims/whitebox.cpp
+12
-2
hotspot/test/gc/whitebox/TestConcMarkCycleWB.java
hotspot/test/gc/whitebox/TestConcMarkCycleWB.java
+57
-0
hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
+6
-2
未找到文件。
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
浏览文件 @
fe6b88ab
...
...
@@ -2257,6 +2257,7 @@ bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) {
case
GCCause
::
_java_lang_system_gc
:
return
ExplicitGCInvokesConcurrent
;
case
GCCause
::
_g1_humongous_allocation
:
return
true
;
case
GCCause
::
_update_allocation_context_stats_inc
:
return
true
;
case
GCCause
::
_wb_conc_mark
:
return
true
;
default:
return
false
;
}
}
...
...
hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp
浏览文件 @
fe6b88ab
...
...
@@ -92,12 +92,8 @@ bool VM_G1IncCollectionPause::doit_prologue() {
void
VM_G1IncCollectionPause
::
doit
()
{
G1CollectedHeap
*
g1h
=
G1CollectedHeap
::
heap
();
assert
(
!
_should_initiate_conc_mark
||
((
_gc_cause
==
GCCause
::
_gc_locker
&&
GCLockerInvokesConcurrent
)
||
(
_gc_cause
==
GCCause
::
_java_lang_system_gc
&&
ExplicitGCInvokesConcurrent
)
||
_gc_cause
==
GCCause
::
_g1_humongous_allocation
||
_gc_cause
==
GCCause
::
_update_allocation_context_stats_inc
),
"only a GC locker, a System.gc(), stats update or a hum allocation induced GC should start a cycle"
);
assert
(
!
_should_initiate_conc_mark
||
g1h
->
should_do_concurrent_full_gc
(
_gc_cause
),
"only a GC locker, a System.gc(), stats update, whitebox, or a hum allocation induced GC should start a cycle"
);
if
(
_word_size
>
0
)
{
// An allocation has been requested. So, try to do that first.
...
...
hotspot/src/share/vm/gc_interface/gcCause.cpp
浏览文件 @
fe6b88ab
...
...
@@ -54,6 +54,9 @@ const char* GCCause::to_string(GCCause::Cause cause) {
case
_wb_young_gc
:
return
"WhiteBox Initiated Young GC"
;
case
_wb_conc_mark
:
return
"WhiteBox Initiated Concurrent Mark"
;
case
_update_allocation_context_stats_inc
:
case
_update_allocation_context_stats_full
:
return
"Update Allocation Context Stats"
;
...
...
hotspot/src/share/vm/gc_interface/gcCause.hpp
浏览文件 @
fe6b88ab
...
...
@@ -47,6 +47,7 @@ class GCCause : public AllStatic {
_heap_inspection
,
_heap_dump
,
_wb_young_gc
,
_wb_conc_mark
,
_update_allocation_context_stats_inc
,
_update_allocation_context_stats_full
,
...
...
hotspot/src/share/vm/prims/whitebox.cpp
浏览文件 @
fe6b88ab
...
...
@@ -49,6 +49,7 @@
#if INCLUDE_ALL_GCS
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp"
#include "gc_implementation/g1/concurrentMark.hpp"
#include "gc_implementation/g1/concurrentMarkThread.hpp"
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
#include "gc_implementation/g1/heapRegionRemSet.hpp"
#endif // INCLUDE_ALL_GCS
...
...
@@ -266,8 +267,16 @@ WB_END
WB_ENTRY
(
jboolean
,
WB_G1InConcurrentMark
(
JNIEnv
*
env
,
jobject
o
))
G1CollectedHeap
*
g1
=
G1CollectedHeap
::
heap
();
ConcurrentMark
*
cm
=
g1
->
concurrent_mark
();
return
cm
->
concurrent_marking_in_progress
();
return
g1
->
concurrent_mark
()
->
cmThread
()
->
during_cycle
();
WB_END
WB_ENTRY
(
jboolean
,
WB_G1StartMarkCycle
(
JNIEnv
*
env
,
jobject
o
))
G1CollectedHeap
*
g1h
=
G1CollectedHeap
::
heap
();
if
(
!
g1h
->
concurrent_mark
()
->
cmThread
()
->
during_cycle
())
{
g1h
->
collect
(
GCCause
::
_wb_conc_mark
);
return
true
;
}
return
false
;
WB_END
WB_ENTRY
(
jint
,
WB_G1RegionSize
(
JNIEnv
*
env
,
jobject
o
))
...
...
@@ -1106,6 +1115,7 @@ static JNINativeMethod methods[] = {
{
CC
"g1IsHumongous"
,
CC
"(Ljava/lang/Object;)Z"
,
(
void
*
)
&
WB_G1IsHumongous
},
{
CC
"g1NumFreeRegions"
,
CC
"()J"
,
(
void
*
)
&
WB_G1NumFreeRegions
},
{
CC
"g1RegionSize"
,
CC
"()I"
,
(
void
*
)
&
WB_G1RegionSize
},
{
CC
"g1StartConcMarkCycle"
,
CC
"()Z"
,
(
void
*
)
&
WB_G1StartMarkCycle
},
#endif // INCLUDE_ALL_GCS
#if INCLUDE_NMT
{
CC
"NMTMalloc"
,
CC
"(J)J"
,
(
void
*
)
&
WB_NMTMalloc
},
...
...
hotspot/test/gc/whitebox/TestConcMarkCycleWB.java
0 → 100644
浏览文件 @
fe6b88ab
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test TestConMarkCycleWB
* @bug 8065579
* @requires vm.gc=="null" | vm.gc=="G1"
* @library /testlibrary /testlibrary/whitebox
* @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.WhiteBox TestConcMarkCycleWB
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseG1GC TestConcMarkCycleWB
* @summary Verifies that ConcurrentMarking-related WB works properly
*/
import
static
com
.
oracle
.
java
.
testlibrary
.
Asserts
.
assertFalse
;
import
static
com
.
oracle
.
java
.
testlibrary
.
Asserts
.
assertTrue
;
import
sun.hotspot.WhiteBox
;
public
class
TestConcMarkCycleWB
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
WhiteBox
wb
=
WhiteBox
.
getWhiteBox
();
wb
.
youngGC
();
assertTrue
(
wb
.
g1StartConcMarkCycle
());
while
(
wb
.
g1InConcurrentMark
())
{
Thread
.
sleep
(
5
);
}
wb
.
fullGC
();
assertTrue
(
wb
.
g1StartConcMarkCycle
());
while
(
wb
.
g1InConcurrentMark
())
{
Thread
.
sleep
(
5
);
}
assertTrue
(
wb
.
g1StartConcMarkCycle
());
}
}
hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
浏览文件 @
fe6b88ab
...
...
@@ -162,12 +162,16 @@ public class WhiteBox {
public
native
long
incMetaspaceCapacityUntilGC
(
long
increment
);
public
native
long
metaspaceCapacityUntilGC
();
//
f
orce Young GC
//
F
orce Young GC
public
native
void
youngGC
();
//
f
orce Full GC
//
F
orce Full GC
public
native
void
fullGC
();
// Method tries to start concurrent mark cycle.
// It returns false if CM Thread is always in concurrent cycle.
public
native
boolean
g1StartConcMarkCycle
();
// Tests on ReservedSpace/VirtualSpace classes
public
native
int
stressVirtualSpaceResize
(
long
reservedSpaceSize
,
long
magnitude
,
long
iterations
);
public
native
void
runMemoryUnitTests
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录