add log for repeat/space cost too much memory

This commit is contained in:
obdev
2023-09-08 11:51:25 +08:00
committed by ob-robot
parent 7ae7b9560f
commit 73ae6ba395
2 changed files with 4 additions and 0 deletions

View File

@ -210,6 +210,9 @@ int ObExprRepeat::repeat_text(ObObjType res_type,
int64_t tot_length = length * count;
int64_t buffer_len = 0;
char *buf = NULL;
if (tot_length >= MEM_WARN_THRESHOLD) {
LOG_INFO("once repeat cost over 100M", K(ret), K(tot_length), K(length), K(count));
}
ObTextStringResult result_buffer(res_type, has_lob_header, &allocator);
if (OB_FAIL(result_buffer.init(tot_length))) {
LOG_WARN("init result failed", K(ret), K(tot_length));

View File

@ -62,6 +62,7 @@ public:
ObIAllocator &allocator,
const int64_t max_result_size);
private:
static const int64_t MEM_WARN_THRESHOLD = 100 * 1024 * 1024; // 100M
// disallow copy
DISALLOW_COPY_AND_ASSIGN(ObExprRepeat);
};