OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.2.5

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & CertificationTicket
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.2.5
    iconOceanBase Database
    SQL - V 4.2.5
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    GV$OB_MEMORY

    Last Updated:2026-04-27 03:14:13  Updated
    share
    What is on this page
    Purpose
    Columns
    CTX_NAME values
    Correspondence between CTX_NAME and MOD_NAME
    Impact of common SQL operations on memory CTX
    Sample query
    References

    folded

    share

    Note

    • This view was renamed from GV$MEMORY to GV$OB_MEMORY starting from V4.0.0. In V4.0.0 and later versions, you must use the new view name GV$OB_MEMORY to query. Using the old view name GV$MEMORY will result in an error.
      • Purpose

        The GV$OB_MEMORY view displays memory statistics for all tenants on all nodes.

        Columns

        Column
        Type
        Nullable
        Description
        TENANT_ID bigint(20) NO The tenant ID.
        SVR_IP varchar(46) NO The IP address of the server.
        SVR_PORT bigint(20) NO The port number of the server.
        CTX_NAME varchar(256) NO The name of the CTX to which the memory belongs.
        MOD_NAME varchar(256) NO The name of the Mod to which the memory belongs.
        COUNT decimal(20,0) NO The difference between the allocated and released memory, which indicates the number of memory units currently used by the Mod.
        HOLD decimal(20,0) NO The size of memory currently occupied by the Mod.
        USED decimal(20,0) NO The size of memory currently used by the Mod, in bytes.

        CTX_NAME values

        The following table lists the names and descriptions of common memory CTXs.

        CTX_NAME
        Description
        DEFAULT_CTX_ID The ID of the context for unallocated memory.
        MEMSTORE_CTX_ID The ID of the context for user MemTable data.
        TRANS_CTX_MGR_ID The ID of the transaction context.
        PLAN_CACHE_CTX_ID The ID of the execution plan cache context.
        GLIBC The memory allocated by using the Glibc Malloc interface.
        CO_STACK The memory for thread execution stacks.
        KVSTORE_CACHE_ID The ID of the dynamic scalable cache.
        META_OBJ_CTX_ID The memory for storing metadata, such as macroblock metadata.
        TX_CALLBACK_CTX_ID The ID of the transaction callback context. This context is used to record partial modifications during transaction execution. When a transaction is committed or rolled back, the corresponding data can be found and operated on.
        LOB_CTX_ID The Allocator ID in the ObLobManager.
        PS_CACHE_CTX_ID The ID of the cache for the PREPARE stmt_name FROM preparable_stmt statement.
        TX_DATA_TABLE The transaction data table. It stores the status of resolved transactions and is used for dumping queries in scenarios such as uncommitted transactions and FAST COMMIT.
        MDS_DATA_ID The ID of the memory for multi-source data.
        LIBEASY The memory for the network framework (EASY).
        LOGGER_CTX_ID The ID of the program log memory context.
        RPC_CTX_ID The ID of the RPC framework memory context.
        PKT_NIO The memory for the network framework (pkt_nio).
        SCHEMA_SERVICE The memory for storing schema metadata, such as tables and databases.

        Correspondence between CTX_NAME and MOD_NAME

        The following table lists the correspondence between CTX_NAME and MOD_NAME.

        CTX_NAME
        MOD_NAME
        TENANT
        DEFAULT_CTX_ID
        • MysqlRequesReco: MySQL request record module
        • LogAggreBuffer: log aggregation buffer module
        • PartitLogServic: partition log service module
        • SqlDtl: SQL detail module
        • TransAudit: transaction audit module
        • IoControl: I/O control module
        • ResultSet: query result set module
        ALL
        • SchemaSysCache: schema system cache module
        • SeArray: sorted array module
        • SstaMicrBlocAll: statistics and microblock module
        • CsSstableReader: compressed SSTable reader
        • TmpBlockManager: temporary block manager
        • TenantSchemMgr: tenant schema manager
        • DecoderCtx: decoder context
        • SqlSqcHandler: SQL semantic processor
        500
        SQL_EXEC_CTX_ID
        • CostBasedRewrit: cost-based rewrite optimizer
        • SqlExecutor: SQL executor
        • SqlPsCache: SQL parameter cache module
        • OB_SQL_AGGR_FUNC_ROW: SQL aggregate function row object
        ALL
        WORK_AREA
        • SqlAggrFuncRow: SQL aggregate function row object
        • WindowAggProc: window aggregation processing module
        • SqLWindoRowStor: window row storage module
        • SqLChunkRowStor: chunk row storage module
        • SqLTempTabLeRow: temporary table row module
        • ConnectByPump: data transfer module for connect operations
        • SqlSortRow: sorted row module
        • SortOpRows: sorted row object collection
        • SqLHashDisRowSt: hash distributed row storage module
        • SqLHashDist: hash distribution module
        • HashNodeGrouRow: hash node grouping row module
        • HashDistinctOp: hash deduplication operation module
        • ArenaHashJoin: hash join memory management module
        • HtOpAlloc: hash table operation allocation module
        PLAN_CACHE_CTX_ID
        • OB_SQL_PHY_PLAN: query plan module
        • OB_SQL_PLAN_CACHE: query plan cache module
        • OB_SQL_PHY_PL_OBJ: query plan object module
        • PRE_CALC_EXPR: precomputed expression module
        TRANS_CTX_MGR_ID
        • PartTranCtxMgr: partition transaction context
        • TenantCtxAlloca: tenant allocation context
        TX_CALLBACK_CTX_ID MemtableCallbac: memory table callback module
        REPLAY_STATUS_CTX_ID ReplayStatus: replay status module
        CO_STACK CO_STACK: coroutine stack module 500
        STORAGE_LONG_TERM_META_CTX_ID
        • Partition: partition object
        • PartitioStore: partition storage module
        • PartitioStorage: partition storage
        STORAGE_SHORT_TERM_META_CTX_ID
        • Sstable: SSTable table
        • SstableMeta: meta tenant SSTable table
        • MemtableObject: memory table object
        ALL OB_COMMON_ARRAY: OceanBase common array ALL

        Impact of common SQL operations on memory CTX

        In OceanBase Database, each SQL execution or operation corresponds to a specific CTX. Due to variations in data volume and operation complexity, the use of memory CTX can lead to an increase in memory usage. The following are some common SQL operations that may cause an increase in the memory usage of certain CTXs:

        • Sorting large amounts of data (ORDER BY, GROUP BY, etc.): Sorting operations require loading data into memory for sorting, which may lead to an increase in memory usage for PLAN_CACHE_CTX_ID, MEMSTORE_CTX_ID, and DEFAULT_CTX_ID.

        • Aggregating large amounts of data (SUM, AVG, MAX, MIN, etc.): Aggregation operations require loading data into memory for calculations, which may lead to an increase in memory usage for PLAN_CACHE_CTX_ID, MEMSTORE_CTX_ID, and DEFAULT_CTX_ID.

        • Joining large amounts of data (JOIN): Join operations require loading data into memory for matching, which may lead to an increase in memory usage for PLAN_CACHE_CTX_ID, MEMSTORE_CTX_ID, and DEFAULT_CTX_ID.

        • Querying large amounts of data (SELECT): Query operations require loading data into memory for filtering and sorting, which may lead to an increase in memory usage for PLAN_CACHE_CTX_ID, MEMSTORE_CTX_ID, and DEFAULT_CTX_ID.

        • Writing large amounts of data (INSERT, UPDATE, DELETE, etc.): Writing operations require managing and processing transactions, which may lead to an increase in memory usage for TRANS_CTX_MGR_ID, MEMSTORE_CTX_ID, and DEFAULT_CTX_ID.

        • Logging large amounts of data (REDO, UNDO, BINLOG, etc.): Logging operations require loading data into memory for operations, which may lead to an increase in memory usage for TRANS_CTX_MGR_ID, DEFAULT_CTX_ID, LOB_CTX_ID, and TX_DATA_TABLE.

        Sample query

        In the sys tenant, query the memory statistics of tenant 1002 on all nodes and display the first 10 records.

        obclient [oceanbase]> SELECT * FROM GV$OB_MEMORY WHERE TENANT_ID=1002 LIMIT 10;
        

        The query result is as follows:

        +-----------+----------------+----------+----------------+-----------------+-------+-----------+-----------+
        | TENANT_ID | SVR_IP         | SVR_PORT | CTX_NAME       | MOD_NAME        | COUNT | HOLD      | USED      |
        +-----------+----------------+----------+----------------+-----------------+-------+-----------+-----------+
        |      1002 | 172.xx.xxx.xxx |     2882 | CO_STACK       | CoStack         |   196 | 101154816 | 100966656 |
        |      1002 | 172.xx.xxx.xxx |     2882 | CO_STACK       | KvstorCacheMb   |     0 |         0 |         0 |
        |      1002 | 172.xx.xxx.xxx |     2882 | DEFAULT_CTX_ID | ApplySrv        |     1 |    409600 |    401408 |
        |      1002 | 172.xx.xxx.xxx |     2882 | DEFAULT_CTX_ID | APPLY_STATUS    |     1 |      8128 |      7936 |
        |      1002 | 172.xx.xxx.xxx |     2882 | DEFAULT_CTX_ID | ArcFetchQueue   |     1 |   8540160 |   8519680 |
        |      1002 | 172.xx.xxx.xxx |     2882 | DEFAULT_CTX_ID | ArcSenderQueue  |     1 |    933888 |    931072 |
        |      1002 | 172.xx.xxx.xxx |     2882 | DEFAULT_CTX_ID | AsyncFreezeTabl |     1 |    114688 |    111096 |
        |      1002 | 172.xx.xxx.xxx |     2882 | DEFAULT_CTX_ID | Autoincrement   |     1 |     40960 |     37032 |
        |      1002 | 172.xx.xxx.xxx |     2882 | DEFAULT_CTX_ID | Backup          |     1 |     16384 |     12344 |
        |      1002 | 172.xx.xxx.xxx |     2882 | DEFAULT_CTX_ID | BackupIOPerMgr  |     1 |      1152 |       960 |
        +-----------+----------------+----------+----------------+-----------------+-------+-----------+-----------+
        10 rows in set
        

        References

        • View memory usage information
        • Common memory issues

    Previous topic

    GV$LATCH
    Last

    Next topic

    GV$OB_KVCACHE
    Next
    What is on this page
    Purpose
    Columns
    CTX_NAME values
    Correspondence between CTX_NAME and MOD_NAME
    Impact of common SQL operations on memory CTX
    Sample query
    References