-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.report/customerCustomers have encountered this bug.Customers have encountered this bug.severity/majorsig/transactionSIG: TransactionSIG: Transactiontype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
PeerPessimisticLocks is a per-peer data structure that does not release its hash map's memory allocation when items are removed. This leads to a memory leak during bulk insert, delete, or update transactions issued sequentially to regions.
tikv/components/raftstore/src/store/txn_ext.rs
Lines 186 to 192 in 3d2fddc
| pub fn remove(&mut self, key: &Key) { | |
| if let Some((lock, _)) = self.map.remove(key) { | |
| let desc = key.len() + lock.memory_size(); | |
| self.memory_size -= desc; | |
| GLOBAL_MEM_SIZE.sub(desc as i64); | |
| } | |
| } |
A heap profile shows that the accumulated memory allocation from PeerPessimisticLockss is around 8.56 GiB.
What version of TiKV are you using?
v7.5.6
What operating system and CPU are you using?
Steps to reproduce
Issue bulk insert, delete, or update transactions sequentially to regions.
What did you expect?
No memory leak.
What did happened?
Memory leak.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.report/customerCustomers have encountered this bug.Customers have encountered this bug.severity/majorsig/transactionSIG: TransactionSIG: Transactiontype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.