Problem

To achieve stable and good performance, we need to limit the amount of RAM available to SQL Server

Solution

https://github.com/steverezhener/DBA/blob/master/Procedures/bestpractices.usp_change_server_max_memory.sql

Example

Based on https://www.sqlskills.com/blogs/jonathan/wow-an-online-calculator-to-misconfigure-your-sql-server-memory/