Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
89e01df8
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看板
提交
89e01df8
编写于
7月 19, 2012
作者:
Z
zgu
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
06382e86
ce667cc9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
7 deletion
+15
-7
src/share/vm/services/memSnapshot.cpp
src/share/vm/services/memSnapshot.cpp
+1
-1
src/share/vm/services/memTracker.cpp
src/share/vm/services/memTracker.cpp
+11
-5
src/share/vm/services/memTracker.hpp
src/share/vm/services/memTracker.hpp
+3
-1
未找到文件。
src/share/vm/services/memSnapshot.cpp
浏览文件 @
89e01df8
...
...
@@ -173,7 +173,7 @@ MemSnapshot::MemSnapshot() {
_staging_area
=
new
(
std
::
nothrow
)
MemPointerArrayImpl
<
SeqMemPointerRecord
>
();
}
_lock
=
new
(
std
::
nothrow
)
Mutex
(
Monitor
::
native
,
"memSnapshotLock"
);
_lock
=
new
(
std
::
nothrow
)
Mutex
(
Monitor
::
max_nonleaf
-
1
,
"memSnapshotLock"
);
NOT_PRODUCT
(
_untracked_count
=
0
;)
}
...
...
src/share/vm/services/memTracker.cpp
浏览文件 @
89e01df8
...
...
@@ -54,7 +54,7 @@ void SyncThreadRecorderClosure::do_thread(Thread* thread) {
MemRecorder
*
MemTracker
::
_global_recorder
=
NULL
;
MemSnapshot
*
MemTracker
::
_snapshot
=
NULL
;
MemBaseline
MemTracker
::
_baseline
;
Mutex
MemTracker
::
_query_lock
(
Monitor
::
native
,
"NMT_queryLock"
)
;
Mutex
*
MemTracker
::
_query_lock
=
NULL
;
volatile
MemRecorder
*
MemTracker
::
_merge_pending_queue
=
NULL
;
volatile
MemRecorder
*
MemTracker
::
_pooled_recorders
=
NULL
;
MemTrackWorker
*
MemTracker
::
_worker_thread
=
NULL
;
...
...
@@ -89,6 +89,12 @@ void MemTracker::bootstrap_single_thread() {
return
;
}
_query_lock
=
new
(
std
::
nothrow
)
Mutex
(
Monitor
::
max_nonleaf
,
"NMT_queryLock"
);
if
(
_query_lock
==
NULL
)
{
shutdown
(
NMT_out_of_memory
);
return
;
}
debug_only
(
_main_thread_tid
=
os
::
current_thread_id
();)
_state
=
NMT_bootstrapping_single_thread
;
NMT_track_callsite
=
(
_tracking_level
==
NMT_detail
&&
can_walk_stack
());
...
...
@@ -164,7 +170,7 @@ void MemTracker::final_shutdown() {
{
// shared baseline and snapshot are the only objects needed to
// create query results
MutexLockerEx
locker
(
&
_query_lock
,
true
);
MutexLockerEx
locker
(
_query_lock
,
true
);
// cleanup baseline data and snapshot
_baseline
.
clear
();
delete
_snapshot
;
...
...
@@ -536,7 +542,7 @@ void MemTracker::thread_exiting(JavaThread* thread) {
// baseline current memory snapshot
bool
MemTracker
::
baseline
()
{
MutexLockerEx
lock
(
&
_query_lock
,
true
);
MutexLockerEx
lock
(
_query_lock
,
true
);
MemSnapshot
*
snapshot
=
get_snapshot
();
if
(
snapshot
!=
NULL
)
{
return
_baseline
.
baseline
(
*
snapshot
,
false
);
...
...
@@ -547,7 +553,7 @@ bool MemTracker::baseline() {
// print memory usage from current snapshot
bool
MemTracker
::
print_memory_usage
(
BaselineOutputer
&
out
,
size_t
unit
,
bool
summary_only
)
{
MemBaseline
baseline
;
MutexLockerEx
lock
(
&
_query_lock
,
true
);
MutexLockerEx
lock
(
_query_lock
,
true
);
MemSnapshot
*
snapshot
=
get_snapshot
();
if
(
snapshot
!=
NULL
&&
baseline
.
baseline
(
*
snapshot
,
summary_only
))
{
BaselineReporter
reporter
(
out
,
unit
);
...
...
@@ -559,7 +565,7 @@ bool MemTracker::print_memory_usage(BaselineOutputer& out, size_t unit, bool sum
// compare memory usage between current snapshot and baseline
bool
MemTracker
::
compare_memory_usage
(
BaselineOutputer
&
out
,
size_t
unit
,
bool
summary_only
)
{
MutexLockerEx
lock
(
&
_query_lock
,
true
);
MutexLockerEx
lock
(
_query_lock
,
true
);
if
(
_baseline
.
baselined
())
{
MemBaseline
baseline
;
MemSnapshot
*
snapshot
=
get_snapshot
();
...
...
src/share/vm/services/memTracker.hpp
浏览文件 @
89e01df8
...
...
@@ -126,6 +126,8 @@ class MemTracker : AllStatic {
return
"Native memory tracking has been shutdown by user"
;
case
NMT_normal
:
return
"Native memory tracking has been shutdown due to process exiting"
;
case
NMT_out_of_memory
:
return
"Native memory tracking has been shutdown due to out of native memory"
;
case
NMT_initialization
:
return
"Native memory tracking failed to initialize"
;
case
NMT_error_reporting
:
...
...
@@ -336,7 +338,7 @@ class MemTracker : AllStatic {
static
MemBaseline
_baseline
;
// query lock
static
Mutex
_query_lock
;
static
Mutex
*
_query_lock
;
// a thread can start to allocate memory before it is attached
// to VM 'Thread', those memory activities are recorded here.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录