Is it preferred to keep the SQL server Min memory to 0 (default)?

  • Hi

    Seeking expert opinion to know what is the preferred option / value for SQL Server Min Memory?

    Thanks.

  • I have always left the Min Memory value set to 0.

  • I have always set min and max to the same value... basically we are saying we dont want SQL Server to dynamically manage memory.  Basically, i'm defining a set memory size ... yes, I know it will start low and build to that and yes I know it will not yeild back memory to the OS.  In this configuration it's critical that plenty of memory is left for the OS and anything else other than SQL Server that might run on the server.  Typically, we allocate about 70% of memory to SQL Server (and there is huge amounts of memory total and nothing else running on the server except the agent and a few other small consumers)

  • Does Microsoft reveal any best practice to know which one they prefer?

    Thanks.

  • I strongly recommend against setting the min to the max. Something unexpected allocating memory (like a remote connection) and suddenly SQL's memory is in the page file and performance is abysmal. If you're going to do it, you must make absolutely sure that you know that the box will not come under memory pressure.

    0 is usually fine unless you expect external memory pressure and don't want SQL to give up memory (at risk of it getting paged out if other things don't give up memory)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster - Wednesday, November 15, 2017 2:02 PM

    I strongly recommend against setting the min to the max. Something unexpected allocating memory (like a remote connection) and suddenly SQL's memory is in the page file and performance is abysmal. If you're going to do it, you must make absolutely sure that you know that the box will not come under memory pressure.

    0 is usually fine unless you expect external memory pressure and don't want SQL to give up memory (at risk of it getting paged out if other things don't give up memory)

    " suddenly SQL's memory is in the page file and performance is abysmal " .... is that still the case with lock pages in memory set?  If memory serves, what happens when min and max are set to the same value and locked pages is set and another application tries to consumer more memory than is available, is that other application gets an out of memory error (not enough memory available- something to that effect)

  • NJ-DBA - Thursday, November 16, 2017 10:49 AM

    GilaMonster - Wednesday, November 15, 2017 2:02 PM

    I strongly recommend against setting the min to the max. Something unexpected allocating memory (like a remote connection) and suddenly SQL's memory is in the page file and performance is abysmal. If you're going to do it, you must make absolutely sure that you know that the box will not come under memory pressure.

    0 is usually fine unless you expect external memory pressure and don't want SQL to give up memory (at risk of it getting paged out if other things don't give up memory)

    " suddenly SQL's memory is in the page file and performance is abysmal " .... is that still the case with lock pages in memory set?

    No. In that case, depending on what needs the memory, and whether or not the OS can get memory back from something else, either things throw errors or the server crashes (seen that a couple times)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply