5

Is it possible to clear RAM memory from data that SQL Server fill in?

Is there any procedure or option which can do that?

Steve
  • 213,761
  • 22
  • 232
  • 286
veljasije
  • 6,722
  • 12
  • 48
  • 79
  • 2
    Why would you want to do that? – Guffa Feb 01 '13 at 12:22
  • SQL server release memmory after service restart, but if I won't need to restart, how can I clear memmory? I don't know if it is even possible, but I am curious whether SQL Server cover that topic – veljasije Feb 01 '13 at 12:24

2 Answers2

6

You can use

CHECKPOINT
DBCC DROPCLEANBUFFERS

to remove all data pages from memory. It's useful to test server performance: a query performs differently if the data pages it needs are not cached.

Andomar
  • 232,371
  • 49
  • 380
  • 404
2

You don't release memory. If you want it to use less memory, then add the restriction in server settings.

If you did release the memory, it would slow down your queries as everything would have to be read from disk again.

cjk
  • 45,739
  • 9
  • 81
  • 112