Skip to content

Is there any way to calculate or predict the total memory usage of cachebench? #248

Answered by haowu14
hyeongtakji asked this question in Q&A
Discussion options

You must be logged in to vote

I see. I am able to reproduce a similar memory consumption.
The key to your question is that:

  1. cachebench generates all the operations before starting the actual simulation.
  2. the total number of operations is numOps*numThreads. (For example 50m * 48 = 2400m).

Outside of the slab space, the most expensive thing is here: https://github.com/facebook/CacheLib/blob/main/cachelib/cachebench/workload/WorkloadGenerator.cpp#L174C19-L174C19
In the case where there are 2400m operations, that's 2400m * sizeof(uint32_t) ~ 9GB.
The other memory consuming things are:

  1. Keys: there will be 8935378 keys (with some adjustments, but this is the order of magnitude around 9M). But each key's length is drawn fr…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@hyeongtakji
Comment options

@haowu14
Comment options

@hyeongtakji
Comment options

@haowu14
Comment options

Answer selected by hyeongtakji
@hyeongtakji
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants