If you find that SQL server is using too much memory on your server and causing it to run slow and lag then Please see this article:
https://www.javelin-tech.com/blog/2017/11/microsoft-sql-standard-memory-limit/
No matter which version of SQL you are using, the process is the same to limit the memory usage.