Running debian jessie. The following is done as root to avoid any permissions issues. First I find the pid of my program, then I check its open file limit to verify that it is set at 1024. But when I count the number of open files, I find 1851.
$ pgrep -x process_name
673
$ prlimit --pid 673 --nofile
RESOURCE DESCRIPTION SOFT HARD UNITS
NOFILE max number of open files 1024 4096
$ lsof -n -p 673 | grep -c "IPv4"
1851
For good measure, I check that the process doesn't have any subprocesses that it might be delegating file openings to:
$ pgrep -P 673
# no output
What is going wrong here?