[ Web Proxy ]
URL:
Viewing: https://cloud.google.com/sql/docs/sqlserver/optimize-high-memory-usage#sql-server-overhead [Back]  [Original]

Optimize high memory usage in instances  |  Cloud SQL for SQL Server  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

Optimize high memory usage in instances Stay organized with collections Save and categorize content based on your preferences.

This document explains how to review and optimize a Cloud SQL for SQL Server instance if that instance is identified by the underprovisioned instance recommender as having high memory consumption.

SQL Server memory

SQL Server memory can be divided into the following:

Caches

These are objects on a disk that can be reloaded, such as database pages and stored procedures. As a result, the SQL Server can grow and shrink these objects based on memory utilization. Caches include buffer pools and plan caches.

Fixed memory

Fixed memory can grow and shrink. It only shrinks when not in use; for example, when the number of connections drops or the number of queries executing decreases. It's different from caches. If there is not enough fixed memory, SQL Server can run out of memory. Fixed memory includes connection memory and memory grants.

SQL Server overhead

SQL Server overhead includes threads and stacks.

In-Memory OLTP

In-Memory OLTP includes In-Memory tables and In-Memory filegroups.

The memory consumption by SQL Server is controlled by setting maximum server memory and memory.memory.limitmb. The memory.memory.limitmb parameter is set by Cloud SQL automatically.

To learn more about memory.memory.limitmb, see the Microsoft documentation.

Memory optimization options

To determine if an instance needs more memory tuning, do the following:

Use Metrics Explorer to identify the memory usage

You can review memory usage of the instance with the database/memory/components.usage metric in Metrics Explorer.

Note: If you have less than 10% memory in database/memory/components.cache and database/memory/components.free combined, the risk of an out-of-memory (OOM) event is high. To monitor the memory usage and to prevent OOM events, we recommend that you set up an alerting policy with a metric threshold condition of 90% in database/memory/components.usage.

What's next

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-17 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-17 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page