To see how much RAM memory your computer has, use dmesg|grep -i memory.
For limiting MEM usage of a user, which also limits the programs ran under it
/boot/loader.conf
kern.racct.enable="1"
This must be compiled into the kernel, if it's not already there.
For myusername, use your user or any...