From: Eitan <sig...@hy...> - 2011-03-16 23:17:08
|
Hi, I want to obtain the maximum available open file descriptors of the current user in a linux OS using sigar (ulimit -n). I tried using the Ulimit class but it seems to provide me with the hard limit which is I think the machine maximum configured open file descriptors and not the current user. If I ran ulimit -n in shell I get a different number then what sigar is showing (a lower number) and I need the result to be the ulimit -n which is the soft limit (current user limit). Obviously I want this to be cross OS as much as possible otherwise I would not be using Sigar. I also looked at Sigar.getResourceLimit().getOpenFilesCur() and getOpenFileMax() but it also returns the hard limit. Additionally, is there any other way to obtain the currently used open file descriptors of the current user in one command other then going over all the existing processes pids in a loop and accumulating sigar.getProcFd(pid).getTotal() ? Thanks Eitan |