Can ETS store and retrieve literals without copying and does the literals allocator reclaim and coalesce freed space?

  1. Can ETS store and retrieve literals (constant terms defined in code) without copying? My understanding is that ETS always copies, but perhaps it’s been taught to not copy literals now.

  2. Does the literals allocator reclaim and coalesce freed space? (Back in the HiPE days it would not.) My use case would be to store a largish map in persistent_term, with that map being updated potentially hundreds of times between node restarts.

/Mikael

1 Like

Can ETS store and retrieve literals without copying?

No. ETS always copies all literals including persistent_term.

Does the literals allocator reclaim and coalesce freed space?

Yes. The same as other allocators. But no extra fancy stuff like actively defragment by moving live data around. The only special about the literal allocator is it has its own dedicated virtual address space.

Thanks, my plan should work fine then.