Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
ed207606
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看板
提交
ed207606
编写于
2月 07, 2019
作者:
Z
zgu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8218558: NMT stack traces in output should show mt component for virtual memory allocations
Reviewed-by: shade, stuefe, coleenp
上级
015f654c
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
33 addition
and
25 deletion
+33
-25
src/share/vm/services/allocationSite.hpp
src/share/vm/services/allocationSite.hpp
+4
-1
src/share/vm/services/mallocSiteTable.cpp
src/share/vm/services/mallocSiteTable.cpp
+2
-2
src/share/vm/services/mallocSiteTable.hpp
src/share/vm/services/mallocSiteTable.hpp
+2
-6
src/share/vm/services/memBaseline.cpp
src/share/vm/services/memBaseline.cpp
+3
-3
src/share/vm/services/memReporter.cpp
src/share/vm/services/memReporter.cpp
+19
-10
src/share/vm/services/memReporter.hpp
src/share/vm/services/memReporter.hpp
+1
-1
src/share/vm/services/virtualMemoryTracker.hpp
src/share/vm/services/virtualMemoryTracker.hpp
+2
-2
未找到文件。
src/share/vm/services/allocationSite.hpp
浏览文件 @
ed207606
...
@@ -34,8 +34,9 @@ template <class E> class AllocationSite VALUE_OBJ_CLASS_SPEC {
...
@@ -34,8 +34,9 @@ template <class E> class AllocationSite VALUE_OBJ_CLASS_SPEC {
private:
private:
NativeCallStack
_call_stack
;
NativeCallStack
_call_stack
;
E
e
;
E
e
;
MEMFLAGS
_flag
;
public:
public:
AllocationSite
(
const
NativeCallStack
&
stack
)
:
_call_stack
(
stack
)
{
}
AllocationSite
(
const
NativeCallStack
&
stack
,
MEMFLAGS
flag
)
:
_call_stack
(
stack
),
_flag
(
flag
)
{
}
int
hash
()
const
{
return
_call_stack
.
hash
();
}
int
hash
()
const
{
return
_call_stack
.
hash
();
}
bool
equals
(
const
NativeCallStack
&
stack
)
const
{
bool
equals
(
const
NativeCallStack
&
stack
)
const
{
return
_call_stack
.
equals
(
stack
);
return
_call_stack
.
equals
(
stack
);
...
@@ -52,6 +53,8 @@ template <class E> class AllocationSite VALUE_OBJ_CLASS_SPEC {
...
@@ -52,6 +53,8 @@ template <class E> class AllocationSite VALUE_OBJ_CLASS_SPEC {
// Information regarding this allocation
// Information regarding this allocation
E
*
data
()
{
return
&
e
;
}
E
*
data
()
{
return
&
e
;
}
const
E
*
peek
()
const
{
return
&
e
;
}
const
E
*
peek
()
const
{
return
&
e
;
}
MEMFLAGS
flag
()
const
{
return
_flag
;
}
};
};
#endif // SHARE_VM_SERVICES_ALLOCATION_SITE_HPP
#endif // SHARE_VM_SERVICES_ALLOCATION_SITE_HPP
src/share/vm/services/mallocSiteTable.cpp
浏览文件 @
ed207606
/*
/*
* Copyright (c) 2014, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 201
9
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -158,7 +158,7 @@ MallocSite* MallocSiteTable::lookup_or_add(const NativeCallStack& key, size_t* b
...
@@ -158,7 +158,7 @@ MallocSite* MallocSiteTable::lookup_or_add(const NativeCallStack& key, size_t* b
MallocSiteHashtableEntry
*
head
=
_table
[
index
];
MallocSiteHashtableEntry
*
head
=
_table
[
index
];
while
(
head
!=
NULL
&&
(
*
pos_idx
)
<=
MAX_BUCKET_LENGTH
)
{
while
(
head
!=
NULL
&&
(
*
pos_idx
)
<=
MAX_BUCKET_LENGTH
)
{
MallocSite
*
site
=
head
->
data
();
MallocSite
*
site
=
head
->
data
();
if
(
site
->
flag
s
()
==
flags
&&
site
->
equals
(
key
))
{
if
(
site
->
flag
()
==
flags
&&
site
->
equals
(
key
))
{
return
head
->
data
();
return
head
->
data
();
}
}
...
...
src/share/vm/services/mallocSiteTable.hpp
浏览文件 @
ed207606
...
@@ -37,15 +37,12 @@
...
@@ -37,15 +37,12 @@
// MallocSite represents a code path that eventually calls
// MallocSite represents a code path that eventually calls
// os::malloc() to allocate memory
// os::malloc() to allocate memory
class
MallocSite
:
public
AllocationSite
<
MemoryCounter
>
{
class
MallocSite
:
public
AllocationSite
<
MemoryCounter
>
{
private:
MEMFLAGS
_flags
;
public:
public:
MallocSite
()
:
MallocSite
()
:
AllocationSite
<
MemoryCounter
>
(
NativeCallStack
::
empty_stack
()
),
_flags
(
mtNone
)
{}
AllocationSite
<
MemoryCounter
>
(
NativeCallStack
::
empty_stack
()
,
mtNone
)
{}
MallocSite
(
const
NativeCallStack
&
stack
,
MEMFLAGS
flags
)
:
MallocSite
(
const
NativeCallStack
&
stack
,
MEMFLAGS
flags
)
:
AllocationSite
<
MemoryCounter
>
(
stack
),
_flags
(
flags
)
{}
AllocationSite
<
MemoryCounter
>
(
stack
,
flags
)
{}
void
allocate
(
size_t
size
)
{
data
()
->
allocate
(
size
);
}
void
allocate
(
size_t
size
)
{
data
()
->
allocate
(
size
);
}
...
@@ -55,7 +52,6 @@ class MallocSite : public AllocationSite<MemoryCounter> {
...
@@ -55,7 +52,6 @@ class MallocSite : public AllocationSite<MemoryCounter> {
size_t
size
()
const
{
return
peek
()
->
size
();
}
size_t
size
()
const
{
return
peek
()
->
size
();
}
// The number of calls were made
// The number of calls were made
size_t
count
()
const
{
return
peek
()
->
count
();
}
size_t
count
()
const
{
return
peek
()
->
count
();
}
MEMFLAGS
flags
()
const
{
return
(
MEMFLAGS
)
_flags
;
}
};
};
// Malloc site hashtable entry
// Malloc site hashtable entry
...
...
src/share/vm/services/memBaseline.cpp
浏览文件 @
ed207606
/*
/*
* Copyright (c) 2012, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 201
9
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -63,7 +63,7 @@ int compare_malloc_site(const MallocSite& s1, const MallocSite& s2) {
...
@@ -63,7 +63,7 @@ int compare_malloc_site(const MallocSite& s1, const MallocSite& s2) {
int
compare_malloc_site_and_type
(
const
MallocSite
&
s1
,
const
MallocSite
&
s2
)
{
int
compare_malloc_site_and_type
(
const
MallocSite
&
s1
,
const
MallocSite
&
s2
)
{
int
res
=
compare_malloc_site
(
s1
,
s2
);
int
res
=
compare_malloc_site
(
s1
,
s2
);
if
(
res
==
0
)
{
if
(
res
==
0
)
{
res
=
(
int
)(
s1
.
flag
s
()
-
s2
.
flags
());
res
=
(
int
)(
s1
.
flag
()
-
s2
.
flag
());
}
}
return
res
;
return
res
;
...
@@ -209,7 +209,7 @@ bool MemBaseline::aggregate_virtual_memory_allocation_sites() {
...
@@ -209,7 +209,7 @@ bool MemBaseline::aggregate_virtual_memory_allocation_sites() {
const
ReservedMemoryRegion
*
rgn
;
const
ReservedMemoryRegion
*
rgn
;
VirtualMemoryAllocationSite
*
site
;
VirtualMemoryAllocationSite
*
site
;
while
((
rgn
=
itr
.
next
())
!=
NULL
)
{
while
((
rgn
=
itr
.
next
())
!=
NULL
)
{
VirtualMemoryAllocationSite
tmp
(
*
rgn
->
call_stack
());
VirtualMemoryAllocationSite
tmp
(
*
rgn
->
call_stack
()
,
rgn
->
flag
()
);
site
=
allocation_sites
.
find
(
tmp
);
site
=
allocation_sites
.
find
(
tmp
);
if
(
site
==
NULL
)
{
if
(
site
==
NULL
)
{
LinkedListNode
<
VirtualMemoryAllocationSite
>*
node
=
LinkedListNode
<
VirtualMemoryAllocationSite
>*
node
=
...
...
src/share/vm/services/memReporter.cpp
浏览文件 @
ed207606
/*
/*
* Copyright (c) 2012, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 201
9
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -205,7 +205,7 @@ void MemDetailReporter::report_malloc_sites() {
...
@@ -205,7 +205,7 @@ void MemDetailReporter::report_malloc_sites() {
const
NativeCallStack
*
stack
=
malloc_site
->
call_stack
();
const
NativeCallStack
*
stack
=
malloc_site
->
call_stack
();
stack
->
print_on
(
out
);
stack
->
print_on
(
out
);
out
->
print
(
"%29s"
,
" "
);
out
->
print
(
"%29s"
,
" "
);
MEMFLAGS
flag
=
malloc_site
->
flag
s
();
MEMFLAGS
flag
=
malloc_site
->
flag
();
assert
((
flag
>=
0
&&
flag
<
(
int
)
mt_number_of_types
)
&&
flag
!=
mtNone
,
assert
((
flag
>=
0
&&
flag
<
(
int
)
mt_number_of_types
)
&&
flag
!=
mtNone
,
"Must have a valid memory type"
);
"Must have a valid memory type"
);
print_malloc
(
malloc_site
->
size
(),
malloc_site
->
count
(),
flag
);
print_malloc
(
malloc_site
->
size
(),
malloc_site
->
count
(),
flag
);
...
@@ -231,6 +231,10 @@ void MemDetailReporter::report_virtual_memory_allocation_sites() {
...
@@ -231,6 +231,10 @@ void MemDetailReporter::report_virtual_memory_allocation_sites() {
stack
->
print_on
(
out
);
stack
->
print_on
(
out
);
out
->
print
(
"%28s ("
,
" "
);
out
->
print
(
"%28s ("
,
" "
);
print_total
(
virtual_memory_site
->
reserved
(),
virtual_memory_site
->
committed
());
print_total
(
virtual_memory_site
->
reserved
(),
virtual_memory_site
->
committed
());
MEMFLAGS
flag
=
virtual_memory_site
->
flag
();
if
(
flag
!=
mtNone
)
{
out
->
print
(
" Type=%s"
,
NMTUtil
::
flag_to_name
(
flag
));
}
out
->
print_cr
(
")
\n
"
);
out
->
print_cr
(
")
\n
"
);
}
}
}
}
...
@@ -562,24 +566,24 @@ void MemDetailDiffReporter::diff_virtual_memory_sites() const {
...
@@ -562,24 +566,24 @@ void MemDetailDiffReporter::diff_virtual_memory_sites() const {
void
MemDetailDiffReporter
::
new_malloc_site
(
const
MallocSite
*
malloc_site
)
const
{
void
MemDetailDiffReporter
::
new_malloc_site
(
const
MallocSite
*
malloc_site
)
const
{
diff_malloc_site
(
malloc_site
->
call_stack
(),
malloc_site
->
size
(),
malloc_site
->
count
(),
diff_malloc_site
(
malloc_site
->
call_stack
(),
malloc_site
->
size
(),
malloc_site
->
count
(),
0
,
0
,
malloc_site
->
flag
s
());
0
,
0
,
malloc_site
->
flag
());
}
}
void
MemDetailDiffReporter
::
old_malloc_site
(
const
MallocSite
*
malloc_site
)
const
{
void
MemDetailDiffReporter
::
old_malloc_site
(
const
MallocSite
*
malloc_site
)
const
{
diff_malloc_site
(
malloc_site
->
call_stack
(),
0
,
0
,
malloc_site
->
size
(),
diff_malloc_site
(
malloc_site
->
call_stack
(),
0
,
0
,
malloc_site
->
size
(),
malloc_site
->
count
(),
malloc_site
->
flag
s
());
malloc_site
->
count
(),
malloc_site
->
flag
());
}
}
void
MemDetailDiffReporter
::
diff_malloc_site
(
const
MallocSite
*
early
,
void
MemDetailDiffReporter
::
diff_malloc_site
(
const
MallocSite
*
early
,
const
MallocSite
*
current
)
const
{
const
MallocSite
*
current
)
const
{
if
(
early
->
flag
s
()
!=
current
->
flags
())
{
if
(
early
->
flag
()
!=
current
->
flag
())
{
// If malloc site type changed, treat it as deallocation of old type and
// If malloc site type changed, treat it as deallocation of old type and
// allocation of new type.
// allocation of new type.
old_malloc_site
(
early
);
old_malloc_site
(
early
);
new_malloc_site
(
current
);
new_malloc_site
(
current
);
}
else
{
}
else
{
diff_malloc_site
(
current
->
call_stack
(),
current
->
size
(),
current
->
count
(),
diff_malloc_site
(
current
->
call_stack
(),
current
->
size
(),
current
->
count
(),
early
->
size
(),
early
->
count
(),
early
->
flag
s
());
early
->
size
(),
early
->
count
(),
early
->
flag
());
}
}
}
}
...
@@ -603,21 +607,22 @@ void MemDetailDiffReporter::diff_malloc_site(const NativeCallStack* stack, size_
...
@@ -603,21 +607,22 @@ void MemDetailDiffReporter::diff_malloc_site(const NativeCallStack* stack, size_
void
MemDetailDiffReporter
::
new_virtual_memory_site
(
const
VirtualMemoryAllocationSite
*
site
)
const
{
void
MemDetailDiffReporter
::
new_virtual_memory_site
(
const
VirtualMemoryAllocationSite
*
site
)
const
{
diff_virtual_memory_site
(
site
->
call_stack
(),
site
->
reserved
(),
site
->
committed
(),
0
,
0
);
diff_virtual_memory_site
(
site
->
call_stack
(),
site
->
reserved
(),
site
->
committed
(),
0
,
0
,
site
->
flag
()
);
}
}
void
MemDetailDiffReporter
::
old_virtual_memory_site
(
const
VirtualMemoryAllocationSite
*
site
)
const
{
void
MemDetailDiffReporter
::
old_virtual_memory_site
(
const
VirtualMemoryAllocationSite
*
site
)
const
{
diff_virtual_memory_site
(
site
->
call_stack
(),
0
,
0
,
site
->
reserved
(),
site
->
committed
());
diff_virtual_memory_site
(
site
->
call_stack
(),
0
,
0
,
site
->
reserved
(),
site
->
committed
()
,
site
->
flag
()
);
}
}
void
MemDetailDiffReporter
::
diff_virtual_memory_site
(
const
VirtualMemoryAllocationSite
*
early
,
void
MemDetailDiffReporter
::
diff_virtual_memory_site
(
const
VirtualMemoryAllocationSite
*
early
,
const
VirtualMemoryAllocationSite
*
current
)
const
{
const
VirtualMemoryAllocationSite
*
current
)
const
{
assert
(
early
->
flag
()
==
current
->
flag
(),
"Should be the same"
);
diff_virtual_memory_site
(
current
->
call_stack
(),
current
->
reserved
(),
current
->
committed
(),
diff_virtual_memory_site
(
current
->
call_stack
(),
current
->
reserved
(),
current
->
committed
(),
early
->
reserved
(),
early
->
committed
());
early
->
reserved
(),
early
->
committed
()
,
current
->
flag
()
);
}
}
void
MemDetailDiffReporter
::
diff_virtual_memory_site
(
const
NativeCallStack
*
stack
,
size_t
current_reserved
,
void
MemDetailDiffReporter
::
diff_virtual_memory_site
(
const
NativeCallStack
*
stack
,
size_t
current_reserved
,
size_t
current_committed
,
size_t
early_reserved
,
size_t
early_committed
)
const
{
size_t
current_committed
,
size_t
early_reserved
,
size_t
early_committed
,
MEMFLAGS
flag
)
const
{
outputStream
*
out
=
output
();
outputStream
*
out
=
output
();
// no change
// no change
...
@@ -631,6 +636,10 @@ void MemDetailDiffReporter::diff_virtual_memory_site(const NativeCallStack* stac
...
@@ -631,6 +636,10 @@ void MemDetailDiffReporter::diff_virtual_memory_site(const NativeCallStack* stac
print_virtual_memory_diff
(
current_reserved
,
current_committed
,
print_virtual_memory_diff
(
current_reserved
,
current_committed
,
early_reserved
,
early_committed
);
early_reserved
,
early_committed
);
if
(
flag
!=
mtNone
)
{
out
->
print
(
" Type=%s"
,
NMTUtil
::
flag_to_name
(
flag
));
}
out
->
print_cr
(
")
\n
"
);
out
->
print_cr
(
")
\n
"
);
}
}
src/share/vm/services/memReporter.hpp
浏览文件 @
ed207606
...
@@ -218,7 +218,7 @@ class MemDetailDiffReporter : public MemSummaryDiffReporter {
...
@@ -218,7 +218,7 @@ class MemDetailDiffReporter : public MemSummaryDiffReporter {
void
diff_malloc_site
(
const
NativeCallStack
*
stack
,
size_t
current_size
,
void
diff_malloc_site
(
const
NativeCallStack
*
stack
,
size_t
current_size
,
size_t
currrent_count
,
size_t
early_size
,
size_t
early_count
,
MEMFLAGS
flags
)
const
;
size_t
currrent_count
,
size_t
early_size
,
size_t
early_count
,
MEMFLAGS
flags
)
const
;
void
diff_virtual_memory_site
(
const
NativeCallStack
*
stack
,
size_t
current_reserved
,
void
diff_virtual_memory_site
(
const
NativeCallStack
*
stack
,
size_t
current_reserved
,
size_t
current_committed
,
size_t
early_reserved
,
size_t
early_committed
)
const
;
size_t
current_committed
,
size_t
early_reserved
,
size_t
early_committed
,
MEMFLAGS
flag
)
const
;
};
};
#endif // INCLUDE_NMT
#endif // INCLUDE_NMT
...
...
src/share/vm/services/virtualMemoryTracker.hpp
浏览文件 @
ed207606
...
@@ -69,8 +69,8 @@ class VirtualMemory VALUE_OBJ_CLASS_SPEC {
...
@@ -69,8 +69,8 @@ class VirtualMemory VALUE_OBJ_CLASS_SPEC {
// Virtual memory allocation site, keeps track where the virtual memory is reserved.
// Virtual memory allocation site, keeps track where the virtual memory is reserved.
class
VirtualMemoryAllocationSite
:
public
AllocationSite
<
VirtualMemory
>
{
class
VirtualMemoryAllocationSite
:
public
AllocationSite
<
VirtualMemory
>
{
public:
public:
VirtualMemoryAllocationSite
(
const
NativeCallStack
&
stack
)
:
VirtualMemoryAllocationSite
(
const
NativeCallStack
&
stack
,
MEMFLAGS
flag
)
:
AllocationSite
<
VirtualMemory
>
(
stack
)
{
}
AllocationSite
<
VirtualMemory
>
(
stack
,
flag
)
{
}
inline
void
reserve_memory
(
size_t
sz
)
{
data
()
->
reserve_memory
(
sz
);
}
inline
void
reserve_memory
(
size_t
sz
)
{
data
()
->
reserve_memory
(
sz
);
}
inline
void
commit_memory
(
size_t
sz
)
{
data
()
->
commit_memory
(
sz
);
}
inline
void
commit_memory
(
size_t
sz
)
{
data
()
->
commit_memory
(
sz
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录