-
Notifications
You must be signed in to change notification settings - Fork 336
Heap profiling
Simon Warta edited this page Feb 28, 2024
·
4 revisions
In order to detect memory leaks or excessive memory consumption, we can use DHAT for heap profiling. This is currently set up in the cosmwasm-vm package. It was used to debug this memory usage bug in CosmWasm 1.3 and 1.4.
- Go to repo root and run
cargo run --features dhat-heap --example heap_profiling --release
- Open
dhat-heap.json
in DHAT Viewer - Enjoy
- tgmax is the time of the highest memory usage
- tend is the time of the process end
- The
--runtime
argument allows for longer testing periods, e.g. for running tests for 2 minutes docargo run --features dhat-heap --example heap_profiling --release -- --runtime 120
- In
fn contracts()
you can change the contracts that are executed