What is the unit of memory usage in Z3 statistics?

僤鯓⒐⒋嵵緔 提交于 2019-12-10 20:27:55

问题


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?


回答1:


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


来源:https://stackoverflow.com/questions/25007806/what-is-the-unit-of-memory-usage-in-z3-statistics

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!