Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
88c351ff
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看板
提交
88c351ff
编写于
2月 14, 2012
作者:
F
fparain
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7143760: Memory leak in GarbageCollectionNotifications
Reviewed-by: dholmes, dcubed, kamg
上级
fb371a6b
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
32 addition
and
10 deletion
+32
-10
src/share/vm/services/gcNotifier.cpp
src/share/vm/services/gcNotifier.cpp
+30
-9
src/share/vm/services/gcNotifier.hpp
src/share/vm/services/gcNotifier.hpp
+2
-1
未找到文件。
src/share/vm/services/gcNotifier.cpp
浏览文件 @
88c351ff
/*
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
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
...
@@ -180,17 +180,43 @@ static Handle createGcInfo(GCMemoryManager *gcManager, GCStatInfo *gcStatInfo,TR
...
@@ -180,17 +180,43 @@ static Handle createGcInfo(GCMemoryManager *gcManager, GCStatInfo *gcStatInfo,TR
}
}
void
GCNotifier
::
sendNotification
(
TRAPS
)
{
void
GCNotifier
::
sendNotification
(
TRAPS
)
{
GCNotifier
::
sendNotificationInternal
(
THREAD
);
// Clearing pending exception to avoid premature termination of
// the service thread
if
(
HAS_PENDING_EXCEPTION
)
{
CLEAR_PENDING_EXCEPTION
;
}
}
class
NotificationMark
:
public
StackObj
{
// This class is used in GCNotifier::sendNotificationInternal to ensure that
// the GCNotificationRequest object is properly cleaned up, whatever path
// is used to exit the method.
GCNotificationRequest
*
_request
;
public:
NotificationMark
(
GCNotificationRequest
*
r
)
{
_request
=
r
;
}
~
NotificationMark
()
{
assert
(
_request
!=
NULL
,
"Sanity check"
);
delete
_request
;
}
};
void
GCNotifier
::
sendNotificationInternal
(
TRAPS
)
{
ResourceMark
rm
(
THREAD
);
ResourceMark
rm
(
THREAD
);
HandleMark
hm
(
THREAD
);
GCNotificationRequest
*
request
=
getRequest
();
GCNotificationRequest
*
request
=
getRequest
();
if
(
request
!=
NULL
)
{
if
(
request
!=
NULL
)
{
Handle
objGcInfo
=
createGcInfo
(
request
->
gcManager
,
request
->
gcStatInfo
,
THREAD
);
NotificationMark
nm
(
request
);
Handle
objGcInfo
=
createGcInfo
(
request
->
gcManager
,
request
->
gcStatInfo
,
THREAD
);
Handle
objName
=
java_lang_String
::
create_from_platform_dependent_str
(
request
->
gcManager
->
name
(),
CHECK
);
Handle
objName
=
java_lang_String
::
create_from_platform_dependent_str
(
request
->
gcManager
->
name
(),
CHECK
);
Handle
objAction
=
java_lang_String
::
create_from_platform_dependent_str
(
request
->
gcAction
,
CHECK
);
Handle
objAction
=
java_lang_String
::
create_from_platform_dependent_str
(
request
->
gcAction
,
CHECK
);
Handle
objCause
=
java_lang_String
::
create_from_platform_dependent_str
(
request
->
gcCause
,
CHECK
);
Handle
objCause
=
java_lang_String
::
create_from_platform_dependent_str
(
request
->
gcCause
,
CHECK
);
klassOop
k
=
Management
::
sun_management_GarbageCollectorImpl_klass
(
CHECK
);
klassOop
k
=
Management
::
sun_management_GarbageCollectorImpl_klass
(
CHECK
);
instanceKlassHandle
gc_mbean_klass
(
THREAD
,
k
);
instanceKlassHandle
gc_mbean_klass
(
THREAD
,
k
);
instanceOop
gc_mbean
=
request
->
gcManager
->
get_memory_manager_instance
(
THREAD
);
instanceOop
gc_mbean
=
request
->
gcManager
->
get_memory_manager_instance
(
THREAD
);
instanceHandle
gc_mbean_h
(
THREAD
,
gc_mbean
);
instanceHandle
gc_mbean_h
(
THREAD
,
gc_mbean
);
...
@@ -213,11 +239,6 @@ void GCNotifier::sendNotification(TRAPS) {
...
@@ -213,11 +239,6 @@ void GCNotifier::sendNotification(TRAPS) {
vmSymbols
::
createGCNotification_signature
(),
vmSymbols
::
createGCNotification_signature
(),
&
args
,
&
args
,
CHECK
);
CHECK
);
if
(
HAS_PENDING_EXCEPTION
)
{
CLEAR_PENDING_EXCEPTION
;
}
delete
request
;
}
}
}
}
src/share/vm/services/gcNotifier.hpp
浏览文件 @
88c351ff
/*
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
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
...
@@ -60,6 +60,7 @@ private:
...
@@ -60,6 +60,7 @@ private:
static
GCNotificationRequest
*
last_request
;
static
GCNotificationRequest
*
last_request
;
static
void
addRequest
(
GCNotificationRequest
*
request
);
static
void
addRequest
(
GCNotificationRequest
*
request
);
static
GCNotificationRequest
*
getRequest
();
static
GCNotificationRequest
*
getRequest
();
static
void
sendNotificationInternal
(
TRAPS
);
public:
public:
static
void
pushNotification
(
GCMemoryManager
*
manager
,
const
char
*
action
,
const
char
*
cause
);
static
void
pushNotification
(
GCMemoryManager
*
manager
,
const
char
*
action
,
const
char
*
cause
);
static
bool
has_event
();
static
bool
has_event
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录