What is Automatic Shared Memory Management (ASMM)?

What is Automatic Shared Memory Management (ASMM)?

Gemini said

Think of Automatic Shared Memory Management (ASMM) as the "Smart Thermostat" for your Oracle Database's shared memory.

In the old days (before Oracle 10g), a DBA had to manually decide exactly how many megabytes to give to the Data Cache versus the SQL Cache. If you guessed wrong, your performance tanked. ASMM changes the game by letting the database move memory around in real-time based on the actual workload.


1. The Core Concept: SGA_TARGET

The heart of ASMM is a single initialization parameter: SGA_TARGET.

When you set this value (e.g., SGA_TARGET = 10G), you are telling Oracle: "Here is your total budget for the Shared Global Area. You decide how to split it up among your internal components."

What it Manages Automatically:

Oracle takes control of the five most volatile components of the SGA:

  1. Database Buffer Cache: (The data blocks)

  2. Shared Pool: (The SQL plans and metadata)

  3. Large Pool: (Large allocations like RMAN backups)

  4. Java Pool: (Java-based stored procedures)

  5. Streams Pool: (Data streaming/replication)


2. How it Works: The "Granule" Swap

ASMM doesn't just "guess"; it uses a background process called MMON (Manageability Monitor) to track memory usage.

If the Database sees that the Shared Pool is running out of space (causing SQL parsing errors), but the Buffer Cache has plenty of idle memory, it performs a trade:

  • It de-allocates a Granule (a standard unit of memory, e.g., 16MB) from the Buffer Cache.

  • It immediately re-assigns that Granule to the Shared Pool.

This happens dynamically without a reboot and without kicking users off the system.


3. Why Use ASMM instead of Full Automation (AMM)?

You might wonder: "If AMM (MEMORY_TARGET) manages both SGA and PGA, why use ASMM?"

In high-performance enterprise environments, ASMM is often the "Goldilocks" choice for two reasons:

  • HugePages Support: On Linux, "HugePages" can significantly speed up memory access for large databases. However, Full AMM is usually incompatible with HugePages. ASMM plays perfectly with them.

  • Stability: DBAs often prefer to keep the PGA (user memory) separate so a single "rogue" user running a massive sort doesn't accidentally shrink the entire Database Buffer Cache.


4. Setting Up ASMM: A Quick Cheat Sheet

To enable ASMM, you simply need to set the target and ensure the individual parameters are set to zero (which tells Oracle to take over).

SQL

Note: Even with ASMM, you can set a minimum value for a component. If you set DB_CACHE_SIZE = 2G while SGA_TARGET is active, Oracle will never let the data cache shrink below 2GB, but it can grow it larger if needed.


5. Summary Table: ASMM Benefits

Benefit

Is your Database currently using ASMM?

You can check by running SELECT component, current_size FROM v$sga_dynamic_components;.

Looking for servers Rental ?

Call Our Expert :


  • (call for rental enquiries)

Email us :