Skip to content

Commit

Permalink
[test](memory) find large memory allocation not catch exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Doris-Extras committed May 22, 2024
1 parent c511fe3 commit 3f4325f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions be/src/vec/common/allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ void Allocator<clear_memory_, mmap_populate, use_mmap>::sys_memory_check(size_t
}
}

// Find large memory allocation not catch exception
if (size > 1000000 && !doris::enable_thread_catch_bad_alloc) {
LOG(INFO) << "There is a large allocation " << size << ", not catch exception. "
<< Status::InternalError("bad alloc");
}

if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) {
// Only thread attach query, and has not completely waited for thread_wait_gc_max_milliseconds,
// will wait for gc, asynchronous cancel or throw bad::alloc.
Expand Down
2 changes: 1 addition & 1 deletion regression-test/suites/correctness_p0/test_avg.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ suite("test_avg") {
qt_select """select c_bigint from ${tableName} order by c_bigint"""
qt_sum """ SELECT SUM(c_bigint) FROM ${tableName} """
qt_count """ SELECT COUNT(c_bigint) FROM ${tableName} """
qt_avg """ SELECT AVG(c_bigint) FROM ${tableName} """
qt_avg """ SELECT AVG(c_bigint1) FROM ${tableName} """
sql""" DROP TABLE IF EXISTS ${tableName} """


Expand Down

0 comments on commit 3f4325f

Please sign in to comment.