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
Right now, the anoncreds library has a static hash map to keep all the anoncreds objects, and their associated handle, in memory for access later on. This works fine for languages with a deconstructor, but can be very tedious in languages without a deconstructor, like JavaScript.
We (@TimoGlastra and I) were wondering if it makes sense to just pass a stringified JSON into the library which would remove this issue entirely. It does make referencing a previous anoncreds object a bit more annoying, but it would prevent any unwanted memory leaks.
Timo also mentioned that this is how the indy-sdk has done it. Was there a specific reason why anoncreds derived from that?
Wouldn't you have the same issue passing in a string, in that the buffer needs to be freed afterward?
That would be handled by the GC of the JavaScript runtime. So with the string, once it's out-of-scope (or however the GCs in V8 work) it will be freed but we cannot give a method that should be called when the anoncreds object class, which contains the handle, gets garbage collected. I believe there are some RFCs open for this issue, but it won't be added anytime soon.
Right now, the anoncreds library has a static hash map to keep all the anoncreds objects, and their associated handle, in memory for access later on. This works fine for languages with a deconstructor, but can be very tedious in languages without a deconstructor, like JavaScript.
We (@TimoGlastra and I) were wondering if it makes sense to just pass a stringified JSON into the library which would remove this issue entirely. It does make referencing a previous anoncreds object a bit more annoying, but it would prevent any unwanted memory leaks.
Timo also mentioned that this is how the indy-sdk has done it. Was there a specific reason why anoncreds derived from that?
cc: @andrewwhitehead @TimoGlastra
The text was updated successfully, but these errors were encountered: