buttercup/buttercup-core

Memory leak (from auto-updating?)

perry-mitchell opened this issue · 2 comments

There's a gradual memory leak from core, potentially from the auto-update call:

image

Seems that many strings are allocated over time, with vault contents, and are never deallocated. The strings appear to be both encrypted vault content and unencrypted.

The issue is the references between Vault, Group, Entry and the underlying VaultItem. They're all intertwined, and switching to an EventEmitter listener in 5.3.0-0 didn't help (as there's no weak references).

The solution for now, I think, is to prevent the creation of Group/Entry references when doing a lookup. All Groups and Entries should be created instantly on the Vault, and returned when needed. This way we keep the growth down to only what's required, and we don't trust anything to be automatically garbage collected.

Seems that it's working at least a bit better, I'll push forward with releasing this...

image