Question

What is the unit in which memory usage is measured in z3 statistics? Is it MB or KB?

And what does the memory exactly means? Is it the maximum memory usage or the aggregate sum of all allocations during the execution?

Was it helpful?

Solution

It's an approximation of the maximum heap size during execution and it is added to the statistics object through the following function in cmd_context.cpp:

void cmd_context::display_statistics(...) {
    statistics st;
    ...
    unsigned long long mem = memory::get_max_used_memory();
    ...
    st.update("memory", static_cast<double>(mem)/static_cast<double>(1024*1024));
    ...
}

Thus it is in MB. It is only an approximation though, because the counters are not updated at every allocation; see the following comment in memory_manager.cpp:

// We only integrate the local thread counters with the global one
// when the local counter > SYNCH_THRESHOLD 
#define SYNCH_THRESHOLD 100000
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top