jeromefroe/lru-rs

Full check leak report reachable bytes

Opened this issue · 1 comments

I am running valgrind with a full leak check :

valgrind --leak-check=full --show-leak-kinds=all myExecutable

It reports reachable bytes that seem linked to the usage of LruCache:

==9046== 8 bytes in 1 blocks are still reachable in loss record 2 of 6
==9046==    at 0x483C855: malloc (vg_replace_malloc.c:380)
==9046==    by 0x19004C: once_cell::race::once_box::OnceBox<T>::get_or_init (in /mnt/c/Users/nhanus/dev/git/native/src/simulator/target/release/deps/checkpointing_test-279e8b44c56500c1)
==9046==    by 0x18F12F: lru::LruCache<K,V>::new (in /mnt/c/Users/nhanus/dev/git/native/src/simulator/target/release/deps/checkpointing_test-279e8b44c56500c1)

And

==9160== 64 bytes in 1 blocks are still reachable in loss record 4 of 6
==9160==    at 0x483C855: malloc (vg_replace_malloc.c:380)
==9160==    by 0x1954A4: <ahash::random_state::DefaultRandomSource as ahash::random_state::RandomSource>::get_fixed_seeds (in /mnt/c/Users/nhanus/dev/git/native/src/simulator/target/release/deps/checkpointing_test-279e8b44c56500c1)
==9160==    by 0x18F13C: lru::LruCache<K,V>::new (in /mnt/c/Users/nhanus/dev/git/native/src/simulator/target/release/deps/checkpointing_test-279e8b44c56500c1)

Could you please advise if I'm doing a misuse of the cache, or if there a real issue ? Thx

@NicolasHanus Hi, I am not the maintainer, but I am currently evaluating lru-rs and would love to help. Can you share a small reproducer of this potential leak? Thanks!