You raised `nofile` in `/etc/security/limits.conf` to 65536, but the service still shows `Max open files 1024`.
IntermediateTroubleshootingProcesses, memory and OOM
Answer
Likely causes → limits.conf is applied by PAM to login sessions; systemd services don't go through PAM.
Diagnose →
systemctl show app -p LimitNOFILE
cat /proc/$(systemctl show -p MainPID --value app)/limits | grep 'open files'
Fix →
sudo systemctl edit app
# [Service]
# LimitNOFILE=65536
sudo systemctl restart app
Prevent → Set limits in unit files; use DefaultLimitNOFILE= in /etc/systemd/system.conf for a host-wide default.
More on Processes, memory and OOM
A Java service disappears without an error in its own log. `dmesg` shows `Out of memory: Killed process 4121 (java) total-vm:... anon-rss:...`.BeginnerA service gets killed with `Memory cgroup out of memory: Killed process ...` but the host has 20 GB free.Intermediate`ps` shows dozens of processes in state `Z` with `<defunct>`.BeginnerZombie count keeps climbing into the thousands and new processes fail with `fork: Resource temporarily unavailable`.AdvancedAn app crashes under load with `java.io.IOException: Too many open files` (or `EMFILE`).BeginnerThe whole host can't open files: `VFS: file-max limit 98304 reached` in `dmesg`.Advanced