You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change removes the call to decoder.done() in stable_restore().
Rationale:
* done() almost always returns an error because the input is likely
to contain trailing zero bytes.
* Calling done() has no effect on the return value.
* The error that done() constructs contains the dump of the whole state,
which causes the decoder to allocate huge amounts of memory.
All of these allocations are unnecessary because stable_restore()
throws away the error right away.
Fixes#212.
This change removes the call to decoder.done() in stable_restore().
Rationale:
* done() almost always returns an error because the input is likely
to contain trailing zero bytes.
* Calling done() has no effect on the return value.
* The error that done() constructs contains the dump of the whole state,
which causes the decoder to allocate huge amounts of memory.
All of these allocations are unnecessary because stable_restore()
throws away the error right away.
Fixes#212.
When calling
ic_cdk::storage::stable_restore()
there is obsolete heap memory increase (10x times more than stable memory size).This always happens in ic-cdk/src/storage.rs line 76 because there is an error returned with dump of deserialiser (candid/src/de.rs line 104)
This issue does not depend on restored data structure.
The text was updated successfully, but these errors were encountered: