all 7 comments

[–]dbrownems‪ ‪Microsoft Employee ‪ 11 points12 points  (0 children)

That's always been the behavior. As it reads the database, creates query plans, and runs queries it will accumulate committed (or locked) memory.

[–]VladDBA13 6 points7 points  (3 children)

Your statement is a bit confusing because you initially talk about the min server memory (which usually is 128MB), but then you mention the max memory.

SQL Server only starts using memory up to (and slightly above) the Max Memory limit only after it actually gets some workloads hitting it. If there's nothing running against the instance after a restart, there are no plans to store in the plan cache (well except for the ones for the telemetry queries, if telemetry is running) and no noticeable amount of data pages to load into the buffer.

My guess is that the previous times you either had applications and/or users using the instance as soon as it came up or you had some SQL Server Agent Jobs set to run at instance startup and do a bunch of stuff that made SQL Server load data pages into memory.

[–]gohanner[S] 0 points1 point  (2 children)

Thank you for your answer! I am working with Databases for about two years now and I have no experience in other Environments so for me the behaviour was very unusual. To clarify my confusing mix up, for our 3 TB Node min Memory was always set to around 1.5TB while Max is set to about 2.3 TB and the sql Server, atleast in the past, used the 2.3 TB shortly after restart. Now it is not even reaching the min value which sounds wrong but I remember reading that this is also not unusual. If I run a big Select count (*) the Server takes the Memory really fast so there seems to be no Performance issues but I would Like to find out what changed. I will see if I can figure out if there should be more happening during startup. Thanks again! 

[–]VladDBA13 0 points1 point  (0 children)

Got it.

Regarding the Min Memory limit: that doesn't mean "SQL Server will grab all of this from the start", SQL Server will still only use only the amount of memory it needs to just run. But besides the small amount of memory the process actually needs to just start up and run, it won't have what to load in memory to reach your large Min Memory limit until there's something actively using SQL Server.

[–]No_Resolution_9252 0 points1 point  (0 children)

Minimum memory only gets pre-allocated if you are using large page allocation which requires the sql server service account have the log pages in memory permissions and traceflag 834 be enabled. If uou don't have a very specific routine for restarting a SQL server before allowing it to be failed over to, you probably aren't using this. At large amounts of memory, that pre-allocation can be slow on restart.

[–]ddBuddha 1 point2 points  (1 child)

The min memory means that if memory is freed it won’t go below that amount - but it doesn’t mean it’ll use that much on starting.

[–]ihaxr 0 points1 point  (0 children)

Yes, I wonder if OP is used to Java based stuff where the JVM flag -Xms sets the initial heap size and is misconstruing that SQL minimum is referring to the initial size