-
Notifications
You must be signed in to change notification settings - Fork 242
Open
Labels
Description
Describe the bug
Chained invocations of skim retain lots of memory. I believe there is cycle within skim which prevents Arc<dyn SkimItem> from being dropped.
pub struct MatchedItem {
/// The underlying skim item
pub item: Arc<dyn SkimItem>,
/// The rank/score of this match
pub rank: Rank,
/// Range of characters that matched the pattern
pub matched_range: Option<Box<MatchRange>>,
}To Reproduce
Steps to reproduce the behavior:
- Invoke
skimas a library. - Allow
skimto build up a substantial number of SkimItems (hundreds of thousands). - Search the SkimItems a few times.
- Exit skim invocation, but keep a main process running.
skimretains hundreds megabytes of memory (hundreds of megabytes, even a gigabyte of non-purgeable memory).
Expected behavior
For skim to deallocate as much memory as possible.
Environment (please complete the following information):
- OS (
uname -a): MacOS 26.3 and Ubuntu 24.04.4 skimversion (sk --version): 3.2.0- Shell and version: zsh 5.9-6ubuntu2
- Variables (
env | grep '^SKIM'): None
Reactions are currently unavailable