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 - V2.2.77Enterprise Edition

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogWhite PaperLive 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. V2.2.77
    iconOceanBase Database
    SQL - V 2.2.77Enterprise Edition
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    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

    Common memory issues

    Last Updated:2023-08-18 09:26:34  Updated
    Share
    What is on this page
    Share
    1. ERROR 4030 (HY000): OB-4030:Over tenant memory limits

      When you receive the foregoing error message, first check whether the memory occupied by the MemStore exceeds the specified threshold. If yes, check whether an excessive amount of data is being written into the MemStore and whether throttling is disabled. The error message is returned when a large amount of data is being written into the memstore and the minor compaction speed does not keep up with the data write speed. Run the following statement to check the memory status:

      obclient> SELECT /*+ READ_CONSISTENCY(WEAK),query_timeout(100000000) */ TENANT_ID,IP,
                 round(ACTIVE/1024/1024/1024,2)ACTIVE_GB,
                 round(TOTAL/1024/1024/1024,2) TOTAL_GB,
                 round(FREEZE_TRIGGER/1024/1024/1024,2) FREEZE_TRIGGER_GB,
                 round(TOTAL/FREEZE_TRIGGER*100,2) percent_trigger,
                 round(MEM_LIMIT/1024/1024/1024,2) MEM_LIMIT_GB 
      FROM gv$memstore
      WHERE tenant_id >1000 OR TENANT_ID=1
      ORDER BY tenant_id,TOTAL_GB DESC;
      

      The emergency workaround to this issue is to scale out the tenant memory. After the issue is temporarily solved, analyze the root cause. If the issue is caused because throttling is not implemented, enable throttling and roll back the tenant memory scale-out operation. If the issue is caused because the memory of the tenant failed to support the growth of business, configure a proper memory size for the tenant based on the minor compaction frequency. If this issue is not caused by a memstore overrun, run the following statement to determine the memory module on which an overrun occurs:

      obclient> SELECT tenant_id,svr_ip,sum(hold) module_sum
      FROM __all_virtual_memory_info
      WHERE tenant_id>1000 AND hold<>0 AND
                   mod_name NOT IN ( 'OB_KVSTORE_CACHE','OB_MEMSTORE')
      GROUP BY tenant_id,svr_ip;
      

      If the value of module_sum of a memory module is greater than the value of min_memory of the tenant, which is greater than the size of the MemStore of the tenant, it is considered an overrun has occurred on the memory module. If an overrun has occurred on a memory module, the memory for the individual memory modules needs to be adjusted by modifying, for example, ob_sql_work_area_percentage. If the memory size of the tenant is too small, scale out the memory size.

    2. The hit rate of the plan cache is less than 90%.

      The hit rate of the plan cache must reach at least 90% for an online transaction processing (OLTP) system. You can run the following statement to check the hit rate of the plan cache:

      obclient> SELECT hit_count,executions,(hit_count/executions) as hit_ratio
      FROM v$plan_cache_plan_stat
      where (hit_count/executions) < 0.9;
      
      SELECT hit_count,executions,(hit_count/executions) AS hit_ratio
      FROM v$plan_cache_plan_stat
      WHERE (hit_count/executions) < 0.9 AND executions > 1000;
      

      Check for similar statements, for example, statements with a random number of parameters following in or not in, which consume a lot of memory unnecessarily. If such statements do not exist, the issue may be caused by insufficient memory resulted from a sudden increase in traffic or sessions. In this case, you need to scale out the memory of the tenant.

    3. Error messages such as fail to alloc memory or allocate memory fail exist in the log.

      The error message contains the tenant_id(tenant ID) and mod_id (memory module ID) information, with which you can obtain the information about the specific memory module by running the following statement:

      obclient> SELECT * FROM __all_virtual_memory_info WHERE mod_id=xxx AND tenant_id = xxx
      

      If a memory overrun occurs on the memory module, you may first need to adjust the memory size for the module, same as the solution to the first issue. If the memory of the tenant is too small, scale out the memory of the tenant.

    Previous topic

    Plan cache
    Last

    Next topic

    About tables
    Next