question

RafayPervaiz-4288 avatar image
0 Votes"
RafayPervaiz-4288 asked ErlandSommarskog commented

MSSQL 2016 Server Logs showing "APPDOMAIN unloading due to memrory pressure" message

Hi, i am running my instance on MSSQL 2016

(Microsoft SQL Server 2016 (SP1-GDR) (KB4505219) - 13.0.4259.0 (X64) Jun 15 2019 19:20:12 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows Server 2016 Datacenter 6.3 <X64> (Build 14393: ) (Hypervisor) )
with 32GB of RAM on server and 31GB configured to max Memory.


100346-image.png
with server intervals of times, we are getting the below messages in the log.


100374-image.png
21-05-16 00:00:48.40 spid15s This instance of SQL Server has been using a process ID of 3120 since 5/15/2021 3:00:37 AM (local) 5/15/2021 7:00:37 AM (UTC). This is an informational message only; no user action is required.
2021-05-16 00:11:57.46 spid97 AppDomain 3 (master.sys[runtime].2) created.
2021-05-16 00:30:00.98 Backup Log was backed up. Database: cayprod, creation date(time): 2019/06/14(14:45:41), first LSN: 206789:3362:1, last LSN: 206803:1236:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'D:\BACKUP\CAYPD-DB1\cayprod\LOG\CAYPD-DB1_cayprod_LOG_20210516_003000.trn'}). This is an informational message only. No user action is required.
2021-05-16 00:30:03.51 Backup Log was backed up. Database: cognos11, creation date(time): 2019/06/26(10:13:55), first LSN: 14104:32227:1, last LSN: 14118:9146:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'D:\BACKUP\CAYPD-DB1\cognos11\LOG\CAYPD-DB1_cognos11_LOG_20210516_003002.trn'}). This is an informational message only. No user action is required.
2021-05-16 01:00:01.21 Backup Log was backed up. Database: cayprod, creation date(time): 2019/06/14(14:45:41), first LSN: 206803:1236:1, last LSN: 206803:5306:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'D:\BACKUP\CAYPD-DB1\cayprod\LOG\CAYPD-DB1_cayprod_LOG_20210516_010000.trn'}). This is an informational message only. No user action is required.
2021-05-16 01:00:02.90 Backup Log was backed up. Database: cognos11, creation date(time): 2019/06/26(10:13:55), first LSN: 14118:9146:1, last LSN: 14118:10241:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'D:\BACKUP\CAYPD-DB1\cognos11\LOG\CAYPD-DB1_cognos11_LOG_20210516_010002.trn'}). This is an informational message only. No user action is required.
2021-05-16 01:05:03.00 spid23s AppDomain 2 (cayprod.cayenta[runtime].1) is marked for unload due to memory pressure.
2021-05-16 01:05:03.00 spid23s AppDomain 2 (cayprod.cayenta[runtime].1) unloaded.


sql-server-generalsql-server-transact-sql
image.png (69.6 KiB)
image.png (27.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ErlandSommarskog avatar image
1 Vote"
ErlandSommarskog answered ErlandSommarskog commented

First, are you experiencing any real problems? With that message, I would not be surprised if you said if you did. Then again, you did not mention any.

Next, you are way behind on versions. You should install SP2 for SQL 2016 and then apply CU17 which is the most recent cumulative update. Not that I would expect this to remove the message, but I always point out when people are on old and unsupported versions.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

We are facing slowness on the application side, I wonder if it's caused by memory leakage.

0 Votes 0 ·

The slowness in the application and the eviction of the AppDomain may certainly be token of the same thing, that is memory pressure.

32 GB of RAM is not a whole lot. For instance I have 64 GB RAM installed on the desktop where I'm typing this. Then again, it all depends on the workload.

Adding more RAM may certainly help. then again, maybe the memory pressure is due to big tables being scanned because of poor indexing or poorly written queries, and if you would fix these issues, you might be able to jog along fine with your 32 GB of RAM,

But since you are on SQL 2016, you have Query Store at your hands. An excellent tool to track down slow queries. And queries that eat too much RAM are likely to be slow, so they will be on top.

...and don't forget to install SP2 and CU17

0 Votes 0 ·

The SP and CU_17 have been applied, now I am seeing a constant usage of memory on the db, while nothing is running.


102532-image.png




0 Votes 0 ·
image.png (75.0 KiB)
Show more comments
Criszhan-msft avatar image
0 Votes"
Criszhan-msft answered

Hi,

AppDomain 2 (cayprod.cayenta[runtime].1) is marked for unload due to memory pressure.

This is an informational message about server memory pressure. The server unloads the application domain to free up server memory.

Please refer to some posts similar to yours about this message and you may get some suggestions.
https://dba.stackexchange.com/questions/246804/unknown-appdomain-66-master-sysruntime-65-is-marked-for-unload-due-to-memory
https://stackoverflow.com/questions/36724857/appdomain-unloaded

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TomPhillips-1744 avatar image
0 Votes"
TomPhillips-1744 answered

SQL Server is designed to use all RAM and never give it up. This is completely normal and expected behavior. If you need RAM for other applications on the same server, you must set the "maximum server memory" to restrict SQL Server memory usage.

Please see:

https://support.microsoft.com/en-us/topic/how-to-adjust-memory-usage-by-using-configuration-options-in-sql-server-d82cc37a-489d-b15f-7166-9a58044ebf5f

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.