remove resource_limit.ulimited, switch to ResourceLimit.INFINITY
This commit is contained in:
1 parent
76260ce6f3
commit
56aa4553f5
5 files changed
+26
-19
No files matched your search
@@ -803,9 +803,6 @@ my %classes = (
|
||||
},
|
||||
],
|
||||
ResourceLimit => [
|
||||
{
|
||||
name => 'unlimited',
|
||||
},
|
||||
{
|
||||
name => 'cpu_cur',
|
||||
},
|
||||
@@ -1143,6 +1140,9 @@ EOF
|
||||
(this.free / 1024) + "K free, " +
|
||||
(this.shared / 1024) + "K shrd";
|
||||
}
|
||||
EOF
|
||||
ResourceLimit => <<'EOF',
|
||||
public static native long INFINITY();
|
||||
EOF
|
||||
Swap => <<'EOF',
|
||||
public String toString() {
|
||||
|
||||
@@ -1248,3 +1248,14 @@ JNIEXPORT jlong SIGAR_JNI(Sigar_getServicePid)
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
JNIEXPORT jlong SIGAR_JNI(ResourceLimit_INFINITY)
|
||||
(JNIEnv *env, jclass cls)
|
||||
{
|
||||
#ifdef WIN32
|
||||
return 0x7fffffff;
|
||||
#else
|
||||
#include <sys/resource.h>
|
||||
return RLIM_INFINITY;
|
||||
#endif
|
||||
}
|
||||
@@ -20,8 +20,8 @@ public class Ulimit extends SigarCommandBase {
|
||||
return "Display system resource limits";
|
||||
}
|
||||
|
||||
private static String format(ResourceLimit rlimit, long val) {
|
||||
if (val == rlimit.getUnlimited()) {
|
||||
private static String format(long val) {
|
||||
if (val == ResourceLimit.INFINITY()) {
|
||||
return "unlimited";
|
||||
}
|
||||
else {
|
||||
@@ -33,23 +33,23 @@ public class Ulimit extends SigarCommandBase {
|
||||
ResourceLimit rlimit = this.sigar.getResourceLimit();
|
||||
|
||||
println("core file size......." +
|
||||
format(rlimit, rlimit.getCoreCur()));
|
||||
format(rlimit.getCoreCur()));
|
||||
println("data seg size........" +
|
||||
format(rlimit, rlimit.getDataCur()));
|
||||
format(rlimit.getDataCur()));
|
||||
println("file size............" +
|
||||
format(rlimit, rlimit.getFileSizeCur()));
|
||||
format(rlimit.getFileSizeCur()));
|
||||
println("max memory size......" +
|
||||
format(rlimit, rlimit.getMemoryCur()));
|
||||
format(rlimit.getMemoryCur()));
|
||||
println("open files..........." +
|
||||
format(rlimit, rlimit.getOpenFilesCur()));
|
||||
format(rlimit.getOpenFilesCur()));
|
||||
println("stack size..........." +
|
||||
format(rlimit, rlimit.getStackCur()));
|
||||
format(rlimit.getStackCur()));
|
||||
println("cpu time............." +
|
||||
format(rlimit, rlimit.getCpuCur()));
|
||||
format(rlimit.getCpuCur()));
|
||||
println("max user processes..." +
|
||||
format(rlimit, rlimit.getProcessesCur()));
|
||||
format(rlimit.getProcessesCur()));
|
||||
println("virual memory........" +
|
||||
format(rlimit, rlimit.getVirtualMemoryCur()));
|
||||
format(rlimit.getVirtualMemoryCur()));
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
Reference in new issue
Block a user