SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

optimizer memory constantly growing

optimizer memory constantly growing

SSC Eights!
SSC Eights! (803 reputation)SSC Eights! (803 reputation)SSC Eights! (803 reputation)SSC Eights! (803 reputation)SSC Eights! (803 reputation)SSC Eights! (803 reputation)SSC Eights! (803 reputation)SSC Eights! (803 reputation)

Group: General Forum Members
Points: 803 Visits: 319
Hello, we are using SQL Server 2012:

select @@version;

--Microsoft SQL Server 2012 - 11.0.2100.60 (X64)
--Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

and our server over the past few weeks has seen the optimizer memory grow from only a few tens of MB to 20GB, 30GB, 40GB, and beyond. It is completely hogging the memory on the server. Our page life expectancy has decreased significantly since more than half of the 60GB of memory available is going to the optimizer. There seems to be no way to stop the optimizer memory from increasing. Our workload is pretty ad hoc, so I enabled optimize for ad hoc workloads, but this did not slow it down. We tested clearing the caches, but it appears optimizer memory is not the plan cache, so clearing them did not help, in fact it may have made it worse since it freed up even more memory for the optimizer to consume. On our healthy servers, this memory is usually less than 1 GB so having it grow to 40GB and higher is surprising to me.

Here's some relevant stats:

total memory for the server is 60GB with 4GB left for the OS. This instance is the only instance of SQL Server and the only software running on the server. No anti-virus is running on it. The flag for process_physical_memory_low is 1, process_virtual_memory_low is 0. The server memory status is "Available physical memory is high". All 60GB are being used. PLE (page life expectancy) ranges from 0 to a few hundred to a thousand, but we are used to 10s or even 100s of thousands. We also collect stats on page reads or hard-faults by taking two snapshots and taking the difference since the counters are cumulative. So page reads /sec is oddly 0 in the past few hours, but I can see as PLE goes down to 0-10, page reads /sec goes way up. Our stolen memory counter is positively correlated with the optimizer memory --- with stolen memory reaching 50GB when the optimizer memory is at 47GB, currently. I can see latch waits /sec is much higher than normal and lots of IO wait stats, probably b/c the disks are being used much more than normal since most memory is going to the optimizer.

Any ideas as to why the optimizer would behave like this in SQL Server 2012? Restarting the server will return us to a low optimizer memory and allow data caching as usual, but I am more interested in possible causes of this behavior as I would expect it to come back over a few weeks anyway after a restart. Thanks much!


You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum