SQL Server memory issue

Heisenberg 261 Reputation points
2023-12-01T13:13:34.4233333+00:00

hi all,

Im getting below error in my errorlog after every couple of weeks. Once this error comes, sql server services shutdown or goes in "admin only mode" then i end up restarting sql services.

9/20/23 5:40 spid232 Error: 701, Severity: 17, State: 130.

9/20/23 5:40 spid232 There is insufficient system memory in resource pool 'default' to run this query.

9/20/23 5:56 spid29s Error: 701, Severity: 17, State: 123. 9/20/23 5:56 spid29s There is insufficient system memory in resource pool 'internal' to run this query.

Process/System Counts Value


Available Physical Mem ory 2316800000

Available Virtual Memo ry 1.39738E+14

Available Paging File 6728937472

Working Set 1388601344

Percent of Committed M emory in WS 99

Page Faults 27480103

System physical memory high 0

System physical memory low 1

Process physical memor y low 0

Process virtual memory low 0

9/20/23 5:59 spid29s

Memory Manager KB


VM Reserved 974977260

VM Committed 8987560

Locked Pages Allocated 509567092

Large Pages Allocated 6383616

Emergency Memory 1024

Emergency Memory In Us e 32

Target Committed 525060344

Current Committed 518554656

Pages Allocated 436441400

Pages Reserved 0

Pages Free 18982560

Pages In Use 499571584

Page Alloc Potential -764256

NUMA Growth Phase 0

Last OOM Factor 1

Last OS Error 0

9/20/23 5:59 spid29s

SQL Server Other
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-12-13T22:09:05.2866667+00:00

    hi @Erland Sommarskog above query does not return any rows.

    Good. This means that you are not using In-memory OLTP (which obviously can outrun your memory if you don't watch out), and you don't seem to have any leaks with OPENXML. (One of the few ways you as a user can introduce a memory leak in SQL Server.)

    I would suggest that you set up a job that inserts the data of these two queries in a table for each query once a day:

    SELECT cast(sysdatetime() as date), * FROM sys.dm_os_memory_clerks ORDER BY pages_kb DESC
    SELECT cast(sysdatetime() as date), * FROM sys.dm_os_memory_objects ORDER BY pages_in_bytes DESC
    

    As you are approaching the out-of-memory condition, something may be climbing to the top.


  2. Javier Villegas 900 Reputation points MVP
    2023-12-15T15:40:28.68+00:00

    Hello

    If your VM has 500 GB RAM and SQL Server Max Memory Setting is 2 TB then you have a problem there.

    I will say you should reduce Max Server Memory to less than 500, maybe 420 GB

    Regards

    Javier

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.