Minimal cycles to delete canister

I can find some results when I search for idle_cycles in the master branch version of the spec.

Anyways, what are you trying to do? I would assume it’s about removing as many cycles as possible from a canister before deleting it. To find the optimal number of cycles, we’ll have to look at how freezing works:

  • A canister gets frozen (rendered unresponsive) if it goes below freezing_threshold * cycles_burned_per_second (the freezing threshold is a number of seconds)
  • cycles_burned_per_second is determined by the amount of memory the canister uses. (Remember the 5$/GB/year? that’s what that refers to)
  • The freezing threshold can be updated to arbitrary numbers: dfx canister update-settings --freezing-threshold <seconds>
  • Assuming you set the freezing threshold to something tiny (say 10 seconds for example) you should be able to send out almost all cycles in the canister before stopping/deleting it
  • For exact numbers I recommend you test locally. The local replica’s behaviour in regards to cycles should exactly mirror mainnet.