To control the quantity of Memory for a namespace, you should use resource quota, you can read this article about resource quota . It's will present you the sxquotas open-source project that help you create and adjust a resource quotas according to the current consumption. This tool allow you to do, for example :
echo "---create a initial resource quota"
sxquotas create myquota stack-minimal
echo "---Adjust and add the double of capacity"
sxquotas adjust myquota 200%
In this example, if your application consume a request.memory to 1Gi, the resource quotas will allow a maximum of 2Gi for request.memory. Same for all resources defined in the myquota resource quota.