Raj
Raj

Reputation: 3462

Getting Memory Consumption using C API in Z3 Solver

When I used -st flag in Z3, I get the memory consumption of Z3. However, I would like to get the same using the C/C++ API. Could someone tell how to do it? I tried to use the API Z3_solver_get_statistics() and then Z3_stats_to_string(). However the resulting string does not contain any information about memory.

Thanks !

Upvotes: 1

Views: 199

Answers (1)

Leonardo de Moura
Leonardo de Moura

Reputation: 21475

This functionality is not exposed in the Z3 API. You can obtain this information by using the method

static unsigned long long get_allocation_size();

in the class memory. This method is defined in the file src/util/memory_manager.h. The idea is to add a new function in the Z3 API that returns this value. If you are using Z3 static library, I believe you can directly access this method by including the memory_manager.h.

Upvotes: 1

Related Questions