[BUG][Timeout][QueryLeak] Fixed memory not released in time (#6221)

* Revert "[Optimize] Put _Tuple_ptrs into mempool when RowBatch is initialized (#6036)"

This reverts commit f254870aeb18752a786586ef5d7ccf952b97f895.

* [BUG][Timeout][QueryLeak] Fixed memory not released in time, Fix Core dump in bloomfilter
This commit is contained in:
stdpain
2021-07-16 12:32:10 +08:00
committed by GitHub
parent c2695e9716
commit bf5db6eefe
4 changed files with 68 additions and 12 deletions

View File

@ -30,6 +30,8 @@ namespace doris {
// more friendly to CPU Cache, and it is easier to use SIMD instructions to
// speed up the implementation.
// BlockBloomFilter will not store null values, and will always return a false if the input is null.
class BlockBloomFilter {
public:
explicit BlockBloomFilter();
@ -51,7 +53,9 @@ public:
void insert(uint32_t hash) noexcept;
// Same as above with convenience of hashing the key.
void insert(const Slice& key) noexcept {
insert(HashUtil::murmur_hash3_32(key.data, key.size, _hash_seed));
if (key.data) {
insert(HashUtil::murmur_hash3_32(key.data, key.size, _hash_seed));
}
}
// Finds an element in the BloomFilter, returning true if it is found and false (with
@ -59,7 +63,11 @@ public:
bool find(uint32_t hash) const noexcept;
// Same as above with convenience of hashing the key.
bool find(const Slice& key) const noexcept {
return find(HashUtil::murmur_hash3_32(key.data, key.size, _hash_seed));
if (key.data) {
return find(HashUtil::murmur_hash3_32(key.data, key.size, _hash_seed));
} else {
return false;
}
}
// Computes the logical OR of this filter with 'other' and stores the result in this