moka: Memory corruption observed when using Moka v0.9.6

Split from #279.

Note: I started looking into Moka because recently we tried using it in https://github.com/MaterializeInc/materialize/pull/19614, but had to revert it because we were observing memory corruption.

  • Moka v0.9.6
  • No stack traces and core dumps are available.
  • The target platform (CPU arch and OS) are yet unknown. => Linux x86_64
  • moka::sync::Cache are used in async contexts.
  • Multiple (many?)Cache instances. (An instance per blob URL. Do not know how many)
  • Weigher and eviction listener (immediate mode) are configured.

I am trying to reproduce the issue using mokabench but no luck: https://github.com/moka-rs/moka/issues/279#issuecomment-1596820321

CC: @ParkMyCar

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

FYI, I got the RAM modules for my PC, and confirmed it can run the test with at least 50,000 actions. I allocated 24GiB of memory and only 8 logical CPU cores to WSL2.

The reason I did not try 200,000 actions is that it will take long time (Estimated ~30 hours). 50,000 actions took 7 hours and 14 minutes. The memory utilization was fine so I had feeling that it could run 200,000 without issue.

Also, before I got the RAM module, I was also able to run 80,000 actions. I found that reducing the number of logical CPU cores for WSL2/Docker will reduce the memory utilization of the test. So I allocated only 8 cores (instead of 20) and 10GiB of memory (instead of 8GiB) to WSL2 and it was able to run 80,000 actions.

@0xdeafbeef Thanks for the offer. Wow, you have a great machine!

I think I am going to be okay. I already ordered the RAM modules and am waiting for them to arrive. I think 32GB should be enough for now.