We're moving an existing DB to a new SQL Server 2019 instance.
If we change the compatibility level to 150, nothing works. Task manager shows that sql server service is consuming all available memory and all queries time out with an error that says
There is insufficient system memory in resource pool internal to run this query
The RAM is completely consumed until no query can be run (all end with the previous error I've mentioned). We've tried with 16, 32 and 64GB of RAM.
Can anyone give any tips on how to debug this?
Notice that it's not a query issue...just changing the compat level is enough to make SQL start exhausting the memory.
Even running a simple scalar function (which internally uses several Substring and cast calls - no table or view selects) is enough to make it consume all the available memory.