Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
Dragonwell11
提交
5cd2631b
D
Dragonwell11
项目概览
LinuxSuRen
/
Dragonwell11
通知
2
Star
0
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,发现更多精彩内容 >>
提交
5cd2631b
编写于
4月 17, 2020
作者:
M
mbaesken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8242626: enhance posix print_rlimit_info
Reviewed-by: mdoerr, gziemski
上级
b0cec71d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
55 addition
and
46 deletion
+55
-46
src/hotspot/os/posix/os_posix.cpp
src/hotspot/os/posix/os_posix.cpp
+55
-46
未找到文件。
src/hotspot/os/posix/os_posix.cpp
浏览文件 @
5cd2631b
...
...
@@ -393,60 +393,69 @@ void os::Posix::print_uptime_info(outputStream* st) {
}
}
void
os
::
Posix
::
print_rlimit_info
(
outputStream
*
st
)
{
st
->
print
(
"rlimit:"
);
static
void
print_rlimit
(
outputStream
*
st
,
const
char
*
msg
,
int
resource
,
bool
output_k
=
false
)
{
struct
rlimit
rlim
;
st
->
print
(
" STACK "
);
getrlimit
(
RLIMIT_STACK
,
&
rlim
);
if
(
rlim
.
rlim_cur
==
RLIM_INFINITY
)
st
->
print
(
"infinity"
);
else
st
->
print
(
UINT64_FORMAT
"k"
,
uint64_t
(
rlim
.
rlim_cur
)
/
1024
);
st
->
print
(
" %s "
,
msg
);
int
res
=
getrlimit
(
resource
,
&
rlim
);
if
(
res
==
-
1
)
{
st
->
print
(
"could not obtain value"
);
}
else
{
// soft limit
if
(
rlim
.
rlim_cur
==
RLIM_INFINITY
)
{
st
->
print
(
"infinity"
);
}
else
{
if
(
output_k
)
{
st
->
print
(
UINT64_FORMAT
"k"
,
uint64_t
(
rlim
.
rlim_cur
)
/
1024
);
}
else
{
st
->
print
(
UINT64_FORMAT
,
uint64_t
(
rlim
.
rlim_cur
));
}
}
// hard limit
st
->
print
(
"/"
);
if
(
rlim
.
rlim_max
==
RLIM_INFINITY
)
{
st
->
print
(
"infinity"
);
}
else
{
if
(
output_k
)
{
st
->
print
(
UINT64_FORMAT
"k"
,
uint64_t
(
rlim
.
rlim_max
)
/
1024
);
}
else
{
st
->
print
(
UINT64_FORMAT
,
uint64_t
(
rlim
.
rlim_max
));
}
}
}
}
st
->
print
(
", CORE "
);
getrlimit
(
RLIMIT_CORE
,
&
rlim
);
if
(
rlim
.
rlim_cur
==
RLIM_INFINITY
)
st
->
print
(
"infinity"
);
else
st
->
print
(
UINT64_FORMAT
"k"
,
uint64_t
(
rlim
.
rlim_cur
)
/
1024
);
void
os
::
Posix
::
print_rlimit_info
(
outputStream
*
st
)
{
st
->
print
(
"rlimit (soft/hard):"
);
print_rlimit
(
st
,
"STACK"
,
RLIMIT_STACK
,
true
);
print_rlimit
(
st
,
", CORE"
,
RLIMIT_CORE
,
true
);
// Isn't there on solaris
#if defined(AIX)
st
->
print
(
", NPROC "
);
st
->
print
(
"%d"
,
sysconf
(
_SC_CHILD_MAX
));
st
->
print
(
", THREADS "
);
getrlimit
(
RLIMIT_THREADS
,
&
rlim
);
if
(
rlim
.
rlim_cur
==
RLIM_INFINITY
)
st
->
print
(
"infinity"
);
else
st
->
print
(
UINT64_FORMAT
,
uint64_t
(
rlim
.
rlim_cur
));
print_rlimit
(
st
,
", THREADS"
,
RLIMIT_THREADS
);
#elif !defined(SOLARIS)
st
->
print
(
", NPROC "
);
getrlimit
(
RLIMIT_NPROC
,
&
rlim
);
if
(
rlim
.
rlim_cur
==
RLIM_INFINITY
)
st
->
print
(
"infinity"
);
else
st
->
print
(
UINT64_FORMAT
,
uint64_t
(
rlim
.
rlim_cur
));
#endif
st
->
print
(
", NOFILE "
);
getrlimit
(
RLIMIT_NOFILE
,
&
rlim
);
if
(
rlim
.
rlim_cur
==
RLIM_INFINITY
)
st
->
print
(
"infinity"
);
else
st
->
print
(
UINT64_FORMAT
,
uint64_t
(
rlim
.
rlim_cur
));
st
->
print
(
", AS "
);
getrlimit
(
RLIMIT_AS
,
&
rlim
);
if
(
rlim
.
rlim_cur
==
RLIM_INFINITY
)
st
->
print
(
"infinity"
);
else
st
->
print
(
UINT64_FORMAT
"k"
,
uint64_t
(
rlim
.
rlim_cur
)
/
1024
);
st
->
print
(
", CPU "
);
getrlimit
(
RLIMIT_CPU
,
&
rlim
);
if
(
rlim
.
rlim_cur
==
RLIM_INFINITY
)
st
->
print
(
"infinity"
);
else
st
->
print
(
UINT64_FORMAT
,
uint64_t
(
rlim
.
rlim_cur
));
st
->
print
(
", DATA "
);
getrlimit
(
RLIMIT_DATA
,
&
rlim
);
if
(
rlim
.
rlim_cur
==
RLIM_INFINITY
)
st
->
print
(
"infinity"
);
else
st
->
print
(
UINT64_FORMAT
"k"
,
uint64_t
(
rlim
.
rlim_cur
)
/
1024
);
st
->
print
(
", FSIZE "
);
getrlimit
(
RLIMIT_FSIZE
,
&
rlim
);
if
(
rlim
.
rlim_cur
==
RLIM_INFINITY
)
st
->
print
(
"infinity"
);
else
st
->
print
(
UINT64_FORMAT
"k"
,
uint64_t
(
rlim
.
rlim_cur
)
/
1024
);
print_rlimit
(
st
,
", NPROC"
,
RLIMIT_NPROC
);
#endif
print_rlimit
(
st
,
", NOFILE"
,
RLIMIT_NOFILE
);
print_rlimit
(
st
,
", AS"
,
RLIMIT_AS
,
true
);
print_rlimit
(
st
,
", CPU"
,
RLIMIT_CPU
);
print_rlimit
(
st
,
", DATA"
,
RLIMIT_DATA
,
true
);
// maximum size of files that the process may create
print_rlimit
(
st
,
", FSIZE"
,
RLIMIT_FSIZE
,
true
);
#if defined(LINUX) || defined(__APPLE__)
// maximum number of bytes of memory that may be locked into RAM
// (rounded down to the nearest multiple of system pagesize)
print_rlimit
(
st
,
", MEMLOCK"
,
RLIMIT_MEMLOCK
,
true
);
#endif
#if defined(SOLARIS)
// maximum size of mapped address space of a process in bytes;
// if the limit is exceeded, mmap and brk fail
print_rlimit
(
st
,
", VMEM"
,
RLIMIT_VMEM
,
true
);
#endif
// MacOS; The maximum size (in bytes) to which a process's resident set size may grow.
#if defined(__APPLE__)
print_rlimit
(
st
,
", RSS"
,
RLIMIT_RSS
,
true
);
#endif
st
->
cr
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录