---
title: ARM 平台 PL 编译阶段 allocate_mapped_memory 分配内存卡住-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于ARM 平台 PL 编译阶段 allocate_mapped_memory 分配内存卡住相关的常见问题和使用技巧，帮助您快速解决ARM 平台 PL 编译阶段 allocate_mapped_memory 分配内存卡住的难题。
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

划线反馈

# ARM 平台 PL 编译阶段 allocate_mapped_memory 分配内存卡住

更新时间：2026-05-29 08:46

适用版本： V4.2.x 内容类型：Troubleshoot  

## 问题现象

在 ARM 平台环境下 OceanBase 数据库 V4.2.1 集群执行 PL 卡在编译阶段，PL 执行非常慢，抓取 obstack 和过滤日志后发现，PL 执行卡在了编译阶段，OceanBase 数据库内存并未完全使用，500 租户只分配了 2G 的内存。还有 100G 内存存在，不确定为何分不出内存。

## 问题原因

在 ARM 平台下 PL 编译如果分配内存跨越了 4G 边界，遇到这种情况会重新分配内存。每次分配结果地址恰好一样，就导致循环分配，现象就是卡在 `allocate_mapped_memory` 这个函数上，同时也存在会有 core 掉的风险。遇到此问题先重启卡住节点解决，后期将在 OceanBase 数据库 V4.2.1 BP8 修复。

## 关键信息

1. PL 执行非常慢，并且 `grep 'allocate_mapped_memory'` 发现卡在了 `allocate_mapped_memory`, 分配的地址如果跨越 4G 边界会重新分配，但是每次分配地址恰好一样，结果都一致，如下图所示。

   ![image001](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/sql/20240813PLMemory001.png)
 2. 抓取 obstack 并搜索 `allocate_mapped_memory` 信息显示如下。

   ```shell
   Threads (178042-T1002_L0_G0)
   #0    0x0000fffbf6487598 in ??? from /usr/lib64/libc-2.28.so
   #1    0x0000fffbf64af6f8 in ??? from /usr/lib64/libc-2.28.so
   #2    0x0000aaac871e2ae8 in oceanbase::jit::core::ObJitMemory::allocate_mapped_memory(long, long) from /home/admin/oceanbase/bin/observer
   #3    0x0000aaac871e3b78 in oceanbase::jit::core::ObJitMemoryGroup::reserve(long, long, long) from /home/admin/oceanbase/bin/observer
   #4    0x0000aaac7b80a044 in llvm::RuntimeDyldImpl::loadObjectImpl(llvm::object::ObjectFile const&) from /home/admin/oceanbase/bin/observer
   #5    0x0000aaac7b81bff4 in llvm::RuntimeDyldELF::loadObject(llvm::object::ObjectFile const&) from /home/admin/oceanbase/bin/observer
   #6    0x0000aaac7b804f54 in llvm::RuntimeDyld::loadObject(llvm::object::ObjectFile const&) from /home/admin/oceanbase/bin/observer
   #7    0x0000aaac871e19fc in llvm::orc::LegacyRTDyldObjectLinkingLayer::ConcreteLinkedObject<std::shared_ptr<llvm::RuntimeDyld::MemoryManager> >::finalize() from /home/admin/oceanbase/bin/observer
   #8    0x0000aaac871e2848 in llvm::Expected<unsigned long> llvm::detail::UniqueFunctionBase<llvm::Expected<unsigned long>>::CallImpl<llvm::orc::LegacyRTDyldObjectLinkingLayer::ConcreteLinkedObject<std::shared_ptr<llvm::RuntimeDyld::MemoryManager> >::getSymbolMaterializer(std::string)::{lambda()#1}>(void*) from /home/admin/oceanbase/bin/observer
   #9    0x0000aaac871df674 in llvm::JITSymbol::getAddress() from /home/admin/oceanbase/bin/observer
   #10   0x0000aaac871df3c4 in oceanbase::jit::core::ObOrcJit::get_function_address(std::string) from /home/admin/oceanbase/bin/observer
   #11   0x0000aaac871c240c in oceanbase::jit::ObLLVMHelper::get_function_address(oceanbase::common::ObString const&) from /home/admin/oceanbase/bin/observer
   #12   0x0000aaac7e0c0848 in oceanbase::pl::ObPLCodeGenerator::generate_normal(oceanbase::pl::ObPLFunction&) from /home/admin/oceanbase/bin/observer
   #13   0x0000aaac7e0bf0e4 in oceanbase::pl::ObPLCodeGenerator::generate(oceanbase::pl::ObPLFunction&) from /home/admin/oceanbase/bin/observer
   #14   0x0000aaac7df81ad0 in oceanbase::pl::ObPLCompiler::compile(_ParseNode const*, unsigned long, oceanbase::pl::ObPLFunction&, oceanbase::common::Ob2DArray<oceanbase::common::ObObjParam, 2079744, oceanbase::common::ObWrapperAllocator, false, oceanbase::common::ObSEArray<oceanbase::common::ObObjParam*, 1l, oceanbase::common::ObWrapperAllocator, false> >*, bool) from /home/admin/oceanbase/bin/observer
   #15   0x0000aaac7df7dfa4 in oceanbase::pl::ObPL::get_pl_function(oceanbase::sql::ObExecContext&, oceanbase::common::Ob2DArray<oceanbase::common::ObObjParam, 2079744, oceanbase::common::ObWrapperAllocator, false, oceanbase::common::ObSEArray<oceanbase::common::ObObjParam*, 1l, oceanbase::common::ObWrapperAllocator, false> >&, unsigned long, oceanbase::common::ObString const&, oceanbase::sql::ObCacheObjGuard&) from /home/admin/oceanbase/bin/observer
   #16   0x0000aaac7df84440 in oceanbase::pl::ObPL::execute(oceanbase::sql::ObExecContext&, oceanbase::common::Ob2DArray<oceanbase::common::ObObjParam, 2079744, oceanbase::common::ObWrapperAllocator, false, oceanbase::common::ObSEArray<oceanbase::common::ObObjParam*, 1l, oceanbase::common::ObWrapperAllocator, false> >&, unsigned long, oceanbase::common::ObString const&, oceanbase::common::ObBitSet<256l, oceanbase::common::ModulePageAllocator, false>&) from /home/admin/oceanbase/bin/observer
   #17   0x0000aaac80a76b3c in oceanbase::sql::ObAnonymousBlockExecutor::execute(oceanbase::sql::ObExecContext&, oceanbase::sql::ObAnonymousBlockStmt&) from /home/admin/oceanbase/bin/observer
   #18   0x0000aaac8084f7c0 in oceanbase::sql::ObCmdExecutor::execute(oceanbase::sql::ObExecContext&, oceanbase::sql::ObICmd&)::$_115::operator()() const from /home/admin/oceanbase/bin/observer
   #19   0x0000aaac816a50e0 in oceanbase::sql::ObCmdExecutor::execute(oceanbase::sql::ObExecContext&, oceanbase::sql::ObICmd&) from /home/admin/oceanbase/bin/observer
   #20   0x0000aaac815ae194 in oceanbase::sql::ObResultSet::execute() from /home/admin/oceanbase/bin/observer
   #21   0x0000aaac815abff4 in oceanbase::sql::ObResultSet::open() from /home/admin/oceanbase/bin/observer
   #22   0x0000aaac8254b048 in oceanbase::sql::ObSql::handle_pl_execute(oceanbase::common::ObString const&, oceanbase::sql::ObSQLSessionInfo&, oceanbase::common::Ob2DArray<oceanbase::common::ObObjParam, 2079744, oceanbase::common::ObWrapperAllocator, false, oceanbase::common::ObSEArray<oceanbase::common::ObObjParam*, 1l, oceanbase::common::ObWrapperAllocator, false> >&, oceanbase::sql::ObResultSet&, oceanbase::sql::ObSqlCtx&, bool, bool) from /home/admin/oceanbase/bin/observer
   #23   0x0000aaac825464a8 in oceanbase::sql::ObSPIService::spi_execute_immediate(oceanbase::pl::ObPLExecCtx*, oceanbase::sql::ObSqlExpression const*, oceanbase::common::ObObjParam**, long const*, long, oceanbase::sql::ObSqlExpression const**, long, oceanbase::common::ObDataType const*, long, bool const*, long const*, bool, bool, bool) from /home/admin/oceanbase/bin/observer
   #24   0x0000fffaa6208188 in ??? from ???
   #25   0x0000fffaa6208188 in ??? from ???

   ```
 3. 日志 `grep 'allocate jit memory failed'` 能搜索到并且有 4013 的报错, 命中以上 3 条可以判断为相同问题。

   ```shell
   observer.log.20240612150222369:[2024-06-12 15:00:05.770943] EDIAG [SQL.CG] allocate_mapped_memory (ob_jit_allocator.cpp:116) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=14][errcode=-4013] allocate jit memory failed(addr=0xffeeffff0000, num_bytes=925, page_size=65536, num_pages=1) BACKTRACE:0x10ce9450 0x5f8fe60 0x5f8fa24 0x5f8f6c0 0x5f8f4c0 0x10bbaa94 0x10bba8f4 0x10bbb8f0 0x538f9f4 0x53a19a4 0x538a904 0x10bb9710 0x10bba578 0x10bb72e4 0x10bb700c 0x10b9a2d0 0x68b9b04 0x68b8354 0x68ac200 0x68db678 0x68fa42c 0x6789fc0 0x6767ca4 0xa752704 0xa532588 0xb0dde90 0xafdb9cc 0xafd97dc 0xb224230 0xb223c74 0xb22270c 0xb2deb40 0x8c7bef4 0xb251884 0x8c7bc40 0xb182d40 0x854ef80 0x85525e4 0x8565554 0xb26c9cc 0xaf33c1c 0xaf2dbec 0x893a63c 0x112b0768 0xffff0e5a878c 0xffff0e4f50dc
   observer.log.20240612150222369:[2024-06-12 15:00:15.782816] ERROR issue_dba_error (ob_log.cpp:1868) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=23][errcode=-4388] Unexpected internal error happen, please checkout the internal errcode(errcode=-4013, file="ob_jit_allocator.cpp", line_no=116, info="allocate jit memory failed")
   observer.log.20240612150222369:[2024-06-12 15:00:15.782831] EDIAG [SQL.CG] allocate_mapped_memory (ob_jit_allocator.cpp:116) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=15][errcode=-4013] allocate jit memory failed(addr=0xffeeffff0000, num_bytes=925, page_size=65536, num_pages=1) BACKTRACE:0x10ce9450 0x5f8fe60 0x5f8fa24 0x5f8f6c0 0x5f8f4c0 0x10bbaa94 0x10bba8f4 0x10bbb8f0 0x538f9f4 0x53a19a4 0x538a904 0x10bb9710 0x10bba578 0x10bb72e4 0x10bb700c 0x10b9a2d0 0x68b9b04 0x68b8354 0x68ac200 0x68db678 0x68fa42c 0x6789fc0 0x6767ca4 0xa752704 0xa532588 0xb0dde90 0xafdb9cc 0xafd97dc 0xb224230 0xb223c74 0xb22270c 0xb2deb40 0x8c7bef4 0xb251884 0x8c7bc40 0xb182d40 0x854ef80 0x85525e4 0x8565554 0xb26c9cc 0xaf33c1c 0xaf2dbec 0x893a63c 0x112b0768 0xffff0e5a878c 0xffff0e4f50dc
   observer.log.20240612150222369:[2024-06-12 15:00:25.794672] ERROR issue_dba_error (ob_log.cpp:1868) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=21][errcode=-4388] Unexpected internal error happen, please checkout the internal errcode(errcode=-4013, file="ob_jit_allocator.cpp", line_no=116, info="allocate jit memory failed")
   observer.log.20240612150222369:[2024-06-12 15:00:25.794687] EDIAG [SQL.CG] allocate_mapped_memory (ob_jit_allocator.cpp:116) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=15][errcode=-4013] allocate jit memory failed(addr=0xffeeffff0000, num_bytes=925, page_size=65536, num_pages=1) BACKTRACE:0x10ce9450 0x5f8fe60 0x5f8fa24 0x5f8f6c0 0x5f8f4c0 0x10bbaa94 0x10bba8f4 0x10bbb8f0 0x538f9f4 0x53a19a4 0x538a904 0x10bb9710 0x10bba578 0x10bb72e4 0x10bb700c 0x10b9a2d0 0x68b9b04 0x68b8354 0x68ac200 0x68db678 0x68fa42c 0x6789fc0 0x6767ca4 0xa752704 0xa532588 0xb0dde90 0xafdb9cc 0xafd97dc 0xb224230 0xb223c74 0xb22270c 0xb2deb40 0x8c7bef4 0xb251884 0x8c7bc40 0xb182d40 0x854ef80 0x85525e4 0x8565554 0xb26c9cc 0xaf33c1c 0xaf2dbec 0x893a63c 0x112b0768 0xffff0e5a878c 0xffff0e4f50dc
   observer.log.20240612150222369:[2024-06-12 15:00:35.806378] ERROR issue_dba_error (ob_log.cpp:1868) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=19][errcode=-4388] Unexpected internal error happen, please checkout the internal errcode(errcode=-4013, file="ob_jit_allocator.cpp", line_no=116, info="allocate jit memory failed")
   observer.log.20240612150222369:[2024-06-12 15:00:35.806393] EDIAG [SQL.CG] allocate_mapped_memory (ob_jit_allocator.cpp:116) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=14][errcode=-4013] allocate jit memory failed(addr=0xffeeffff0000, num_bytes=925, page_size=65536, num_pages=1) BACKTRACE:0x10ce9450 0x5f8fe60 0x5f8fa24 0x5f8f6c0 0x5f8f4c0 0x10bbaa94 0x10bba8f4 0x10bbb8f0 0x538f9f4 0x53a19a4 0x538a904 0x10bb9710 0x10bba578 0x10bb72e4 0x10bb700c 0x10b9a2d0 0x68b9b04 0x68b8354 0x68ac200 0x68db678 0x68fa42c 0x6789fc0 0x6767ca4 0xa752704 0xa532588 0xb0dde90 0xafdb9cc 0xafd97dc 0xb224230 0xb223c74 0xb22270c 0xb2deb40 0x8c7bef4 0xb251884 0x8c7bc40 0xb182d40 0x854ef80 0x85525e4 0x8565554 0xb26c9cc 0xaf33c1c 0xaf2dbec 0x893a63c 0x112b0768 0xffff0e5a878c 0xffff0e4f50dc
   observer.log.20240612150222369:[2024-06-12 15:00:45.818412] ERROR issue_dba_error (ob_log.cpp:1868) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=24][errcode=-4388] Unexpected internal error happen, please checkout the internal errcode(errcode=-4013, file="ob_jit_allocator.cpp", line_no=116, info="allocate jit memory failed")
   observer.log.20240612150222369:[2024-06-12 15:00:45.818426] EDIAG [SQL.CG] allocate_mapped_memory (ob_jit_allocator.cpp:116) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=13][errcode=-4013] allocate jit memory failed(addr=0xffeeffff0000, num_bytes=925, page_size=65536, num_pages=1) BACKTRACE:0x10ce9450 0x5f8fe60 0x5f8fa24 0x5f8f6c0 0x5f8f4c0 0x10bbaa94 0x10bba8f4 0x10bbb8f0 0x538f9f4 0x53a19a4 0x538a904 0x10bb9710 0x10bba578 0x10bb72e4 0x10bb700c 0x10b9a2d0 0x68b9b04 0x68b8354 0x68ac200 0x68db678 0x68fa42c 0x6789fc0 0x6767ca4 0xa752704 0xa532588 0xb0dde90 0xafdb9cc 0xafd97dc 0xb224230 0xb223c74 0xb22270c 0xb2deb40 0x8c7bef4 0xb251884 0x8c7bc40 0xb182d40 0x854ef80 0x85525e4 0x8565554 0xb26c9cc 0xaf33c1c 0xaf2dbec 0x893a63c 0x112b0768 0xffff0e5a878c 0xffff0e4f50dc
   observer.log.20240612150222369:[2024-06-12 15:00:55.830438] ERROR issue_dba_error (ob_log.cpp:1868) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=22][errcode=-4388] Unexpected internal error happen, please checkout the internal errcode(errcode=-4013, file="ob_jit_allocator.cpp", line_no=116, info="allocate jit memory failed")
   observer.log.20240612150222369:[2024-06-12 15:00:55.830453] EDIAG [SQL.CG] allocate_mapped_memory (ob_jit_allocator.cpp:116) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=15][errcode=-4013] allocate jit memory failed(addr=0xffeeffff0000, num_bytes=925, page_size=65536, num_pages=1) BACKTRACE:0x10ce9450 0x5f8fe60 0x5f8fa24 0x5f8f6c0 0x5f8f4c0 0x10bbaa94 0x10bba8f4 0x10bbb8f0 0x538f9f4 0x53a19a4 0x538a904 0x10bb9710 0x10bba578 0x10bb72e4 0x10bb700c 0x10b9a2d0 0x68b9b04 0x68b8354 0x68ac200 0x68db678 0x68fa42c 0x6789fc0 0x6767ca4 0xa752704 0xa532588 0xb0dde90 0xafdb9cc 0xafd97dc 0xb224230 0xb223c74 0xb22270c 0xb2deb40 0x8c7bef4 0xb251884 0x8c7bc40 0xb182d40 0x854ef80 0x85525e4 0x8565554 0xb26c9cc 0xaf33c1c 0xaf2dbec 0x893a63c 0x112b0768 0xffff0e5a878c 0xffff0e4f50dc
   observer.log.20240612150222369:[2024-06-12 15:01:05.842456] ERROR issue_dba_error (ob_log.cpp:1868) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=24][errcode=-4388] Unexpected internal error happen, please checkout the internal errcode(errcode=-4013, file="ob_jit_allocator.cpp", line_no=116, info="allocate jit memory failed")
   observer.log.20240612150222369:[2024-06-12 15:01:05.842470] EDIAG [SQL.CG] allocate_mapped_memory (ob_jit_allocator.cpp:116) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=14][errcode=-4013] allocate jit memory failed(addr=0xffeeffff0000, num_bytes=925, page_size=65536, num_pages=1) BACKTRACE:0x10ce9450 0x5f8fe60 0x5f8fa24 0x5f8f6c0 0x5f8f4c0 0x10bbaa94 0x10bba8f4 0x10bbb8f0 0x538f9f4 0x53a19a4 0x538a904 0x10bb9710 0x10bba578 0x10bb72e4 0x10bb700c 0x10b9a2d0 0x68b9b04 0x68b8354 0x68ac200 0x68db678 0x68fa42c 0x6789fc0 0x6767ca4 0xa752704 0xa532588 0xb0dde90 0xafdb9cc 0xafd97dc 0xb224230 0xb223c74 0xb22270c 0xb2deb40 0x8c7bef4 0xb251884 0x8c7bc40 0xb182d40 0x854ef80 0x85525e4 0x8565554 0xb26c9cc 0xaf33c1c 0xaf2dbec 0x893a63c 0x112b0768 0xffff0e5a878c 0xffff0e4f50dc
   observer.log.20240612150222369:[2024-06-12 15:01:15.854263] ERROR issue_dba_error (ob_log.cpp:1868) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=21][errcode=-4388] Unexpected internal error happen, please checkout the internal errcode(errcode=-4013, file="ob_jit_allocator.cpp", line_no=116, info="allocate jit memory failed")
   observer.log.20240612150222369:[2024-06-12 15:01:15.854277] EDIAG [SQL.CG] allocate_mapped_memory (ob_jit_allocator.cpp:116) [2119604][T1039_L0_G0][T1039][xxxxx-xxxxx-xxxxx-xxxxx] [lt=14][errcode=-4013] allocate jit memory failed(addr=0xffeeffff0000, num_bytes=925, page_size=65536, num_pages=1) BACKTRACE:0x10ce9450 0x5f8fe60 0x5f8fa24 0x5f8f6c0 0x5f8f4c0 0x10bbaa94 0x10bba8f4 0x10bbb8f0 0x538f9f4 0x53a19a4 0x538a904 0x10bb9710 0x10bba578 0x10bb72e4 0x10bb700c 0x10b9a2d0 0x68b9b04 0x68b8354 0x68ac200 0x68db678 0x68fa42c 0x6789fc0 0x6767ca4 0xa752704 0xa532588 0xb0dde90 0xafdb9cc 0xafd97dc 0xb224230 0xb223c74 0xb22270c 0xb2deb40 0x8c7bef4 0xb251884 0x8c7bc40 0xb182d40 0x854ef80 0x85525e4 0x8565554 0xb26c9cc 0xaf33c1c 0xaf2dbec 0x893a63c 0x112b0768 0xffff0e5a878c 0xffff0e4f50dc

   ```

## 问题的风险及影响

执行 PL 卡在编译阶段。

## 影响租户

影响 OceanBase 数据库中的 SYS 租户和 Oracle 租户以及 MySQL 租户。

## 适用版本

OceanBase 数据库 V4.2.1 GA（oceanbase-4.2.1.0-100000182023092722）及之后版本。

## 解决方法及规避方式

- 解决方法：

     - 升级至问题已修复版本。目前已修复的版本包括 OceanBase 数据库 V4.2.1 BP8（oceanbase-4.2.1.8-108000052024072217）及之后版本。
     - 遇到此问题先重启卡住节点。
 - 规避方式：

  遇到此问题先重启卡住节点。

上一篇

[找不到系统包如何处理？](https://www.oceanbase.com/knowledge-base/oceanbase-database-20000001056)

下一篇

[MySQL的存储过程中参数名和列名同名时使用的究竟是哪一个？](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000001260424) ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
