Skip to content

[Bug]: obproxy 4.3.2.0 OB_HASH_BUCKET_CONF_CONTAINER 内存泄漏 #57

@Phoeniwx

Description

@Phoeniwx

Describe the bug

线上obproxy内存占用一直异常增加,长时间后出现内存分配失败报错 (最大内存配置为2G)
通过show proxymemory 命令采集各个模块内存使用情况,发现OB_HASH_BUCKET_CONF_CONTAINER 模块内存占用一直缓慢增加,怀疑存在leak
如图所示:
Image
配置 ALTER PROXYCONFIG SET mem_leak_check_mod_name='OB_HASH_BUCKET_CONF_CONTAINER';后,发现主要有以下两条trace在增加:

oceanbase::common::ObMemLeakChecker::on_alloc(long, char const*, void const*, long)
oceanbase::lib::ObTenantAllocator::alloc(long, oceanbase::lib::ObMemAttr const&) [clone .localalias]
oceanbase::lib::ObMallocAllocator::alloc(long, oceanbase::lib::ObMemAttr const&)
oceanbase::common::ob_malloc_align(long, long, long)
oceanbase::common::ObInitConfigContainer::ObInitConfigContainer()
oceanbase::common::ObClassAllocator<oceanbase::obproxy::omt::ObProxyMultiLevelConfig>::alloc()
oceanbase::obproxy::omt::ObProxyConfigTableProcessor::update_proxy_multi_config(oceanbase::obproxy::omt::ObVipInfo const&, oceanbase::obproxy::omt::ObProxyMultiLevelConfig*&)
oceanbase::obproxy::omt::ObProxyConfigTableProcessor::get_proxy_multi_config(oceanbase::obproxy::obutils::ObVipAddr const&, oceanbase::common::ObString const&, oceanbase::common::ObString const&, unsigned long, oceanbase::obproxy::omt::ObProxyMultiLevelConfig*&)
oceanbase::obproxy::proxy::ObMysqlTransact::ObTransState::get_multi_level_config_item(oceanbase::common::ObString const&, oceanbase::common::ObString const&, oceanbase::obproxy::obutils::ObVipAddr const&, long)
oceanbase::obproxy::proxy::ObMysqlTransact::ObTransState::refresh_mysql_config()
oceanbase::obproxy::proxy::ObMysqlSM::state_client_request_read(int, void*)
oceanbase::obproxy::proxy::ObMysqlSM::main_handler(int, void*)
oceanbase::obproxy::proxy::ObMysqlSM::setup_client_request_read()
oceanbase::obproxy::proxy::ObMysqlSM::handle_api_return()
oceanbase::obproxy::proxy::ObMysqlSMApi::state_api_callout(int, void*)
oceanbase::obproxy::proxy::ObMysqlSMApi::do_api_callout_internal()


oceanbase::common::ObMemLeakChecker::on_alloc(long, char const*, void const*, long)
oceanbase::lib::ObTenantAllocator::alloc(long, oceanbase::lib::ObMemAttr const&) [clone .localalias]
oceanbase::lib::ObMallocAllocator::alloc(long, oceanbase::lib::ObMemAttr const&)
oceanbase::common::ob_malloc_align(long, long, long)
oceanbase::common::ObInitConfigContainer::ObInitConfigContainer()
oceanbase::common::ObClassAllocator<oceanbase::obproxy::omt::ObProxyMultiLevelConfig>::alloc()
oceanbase::obproxy::omt::ObProxyConfigTableProcessor::update_proxy_multi_config(oceanbase::obproxy::omt::ObVipInfo const&, oceanbase::obproxy::omt::ObProxyMultiLevelConfig*&)
oceanbase::obproxy::omt::ObProxyConfigTableProcessor::get_proxy_multi_config(oceanbase::obproxy::obutils::ObVipAddr const&, oceanbase::common::ObString const&, oceanbase::common::ObString const&, unsigned long, oceanbase::obproxy::omt::ObProxyMultiLevelConfig*&)
oceanbase::obproxy::proxy::ObMysqlTransact::ObTransState::get_multi_level_config_item(oceanbase::common::ObString const&, oceanbase::common::ObString const&, oceanbase::obproxy::obutils::ObVipAddr const&, long)
oceanbase::obproxy::proxy::ObMysqlTransact::ObTransState::refresh_mysql_config()
oceanbase::obproxy::proxy::ObMysqlSM::save_user_login_info(oceanbase::obproxy::proxy::ObClientSessionInfo&, oceanbase::obproxy::proxy::ObHSRResult&)
oceanbase::obproxy::proxy::ObMysqlSM::analyze_login_request(oceanbase::obproxy::proxy::ObRequestAnalyzeCtx&, oceanbase::obproxy::proxy::ObMysqlAnalyzeStatus&)
oceanbase::obproxy::proxy::ObMysqlSM::analyze_mysql_request(oceanbase::obproxy::proxy::ObMysqlAnalyzeStatus&, bool)
oceanbase::obproxy::proxy::ObMysqlSM::handle_first_request_packet(oceanbase::obproxy::proxy::ObMysqlAnalyzeStatus&, long&)
oceanbase::obproxy::proxy::ObMysqlSM::state_client_request_read(int, void*)
oceanbase::obproxy::proxy::ObMysqlSM::main_handler(int, void*)

Environment

Version: 4.3.2.0

Fast reproduce steps

暂无

Expected behavior

No response

Actual behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions