As SQL Server does automatic Memory management , what this means is SQL Server will ask for memory from the OS as much as it requires, and will keep it as long as it can. This is intended and a default behavior of SQL Server. The memory component (Buffer Pool) does this. So, when does SQL Server release memory back to the OS? It releases memory back to the OS when any other process will ask for memory from the OS. Despite this automatic memory management, there are 2 commands that can be used to free up memory in SQL Server.
DBCC FREEPROCCACHE :- To flush out execution plans from the procedure cache &
DBCC DROPCLEANBUFFERS :- To flush out data pages from the memory.