Currently, we have a strong reference to the data. So, if the data references one of the keys, it will never be released.
The implementation in wasm_of_ocaml uses a chain of WeakMaps: to access the data, we iteratively perform a lookup using each key in turn.
The implementation is also probably racy. It uses a FinalizationRegistry which is asynchronous. So, a newly set data might get deleted if the previous data was considered as garbage. This is probably no longer an issue since ephemerons are immutable since OCaml 5.0.0.