From 35d5e9004981bc85cf038ca30eb1cb4e31b68b6f Mon Sep 17 00:00:00 2001 From: obdev Date: Thu, 8 Feb 2024 04:15:17 +0000 Subject: [PATCH] [to #53220315] add debug info for opaque memory used --- src/pl/ob_pl_user_type.cpp | 9 +++++++++ src/pl/ob_pl_user_type.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pl/ob_pl_user_type.cpp b/src/pl/ob_pl_user_type.cpp index 4d1c8e197..6b7459482 100644 --- a/src/pl/ob_pl_user_type.cpp +++ b/src/pl/ob_pl_user_type.cpp @@ -4500,6 +4500,15 @@ int64_t ObPLAssocArray::get_last() return last_; } +ObIAllocator& ObPLOpaque::get_allocator() +{ + int ret = OB_SUCCESS; + if (allocator_.used() > 1024 * 1024 * 512) { + LOG_ERROR("opaque allocator hold too much memory", K(allocator_.used())); + } + return allocator_; +} + int ObPLOpaque::deep_copy(ObPLOpaque *dst) { int ret = OB_SUCCESS; diff --git a/src/pl/ob_pl_user_type.h b/src/pl/ob_pl_user_type.h index f67985855..7ee6b87a9 100644 --- a/src/pl/ob_pl_user_type.h +++ b/src/pl/ob_pl_user_type.h @@ -1206,7 +1206,7 @@ public: inline bool is_xmltype() const { return ObPLOpaqueType::PL_XML_TYPE == type_; } inline bool is_json_type() const { return ObPLOpaqueType::PL_JSON_TYPE == type_; } - inline ObIAllocator& get_allocator() { return allocator_; } + ObIAllocator& get_allocator(); // { return allocator_; } virtual int deep_copy(ObPLOpaque *dst);