since upgrading to 4.5 it seems sometimes I run out of memory. I remember having this problem before and solving it changing the default "maxproc" value in login.conf. I did it again, but still have problems. What are safe values to set? Should I just use "infinity"? And is it any problem? Why are the default so low? Or should I look at some other setting maybe in sysctl.conf? This is my login.conf, default:

The "default" login class values are low in order to manage a number of users/processes on a single system. Note the "staff" login class limits are higher.

If you're getting "cannot fork" errors, this is likely due to the "maxproc" value.

Note that the resource limits for "staff" are higher than for "default". If this is a single-person workstation, consider setting your personal user to the "staff" class.

The reason for these limits is to have a manageable, functioning OS. If there are no no resource limitations, it would be possible that a run-away application could consume all CPU and all available RAM, preventing an admin from executing even a kill to stop the application.