I've written the application SameSame. The application can be a drain on the vnodes (FreeBSD) depending on the user. The leaves the system unresponsive can. I was thinking to check the number of vnodes left and pause early.My question is just how to do this so it doesn't just work under FreeBSD but also Linux and other OS?

Under FreeBSD the system can be made responsive again by raising kern.maxvnodes with sysctl.