I have a problem where I need to find out the hard and soft open file limits for the process in linux from within a java/groovy program. When I execute ulimit from the termi
Groovy is setting this limit to maximum in it's start-up scripts.
In startGroovy:160:
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query businessSystem maximum file
descriptor limit: $MAX_FD_LIMIT"
fi
fi
It turns out jvm is setting this limit by itself. I'm not sure why groovy is changing it too. Try:
java -XX:-MaxFDLimit LinuxInteractor
It will disable this behavior.