Search

Wednesday, July 27, 2011

Free up sql memory

In prod environments it is often not possible to restart a service just to free up memory. Now we have had some servers with memory related problem and we had to free upp the memory to solv the cases. One easy way that works in most cases is to run those commands:

DBCC FREESYSTEMCACHE ('all')
DBCC FREESESSIONCACHE
DBCC FREEPROCCACHE
DBCC DROPCLEANBUFFERS

They will free upp the memory and mark all SP for recompilations, remove all caached queryplans and all chached data pages. We have had had one server that did not responsd to those commands and then the only other option is to restart.

No comments:

Post a Comment