Step::1 Login to WHM root and go to Plugins section
Step::2 Click over ConfigServer Security & Firewall
Step::3 Now go to the CSF tab and click on Firewall Configuration
Step::4 Next click on the drop down menu and choose Process Tracking
Step::5 Now you can set here various parameters related to RAM like PT_USERMEM. Here we setting this value to 512 which means the RAM usage for each cPanel user will be limited to 512 MB.
Step::6 In the same way PT_USERRSS option refers to virtual memory usage. You can set this limit to something like 256 MB
Step::7 Next you need to switch ON the option- PT_USERKILL option then if this value exceeds then it will be automatically killed.
Step::8 Finally click over Change button.
In this way you can limit RAM usage for all cPanel users via CSF in WHM.