[erlang-questions] ETS memory fragmentation after deleting data

Lukas Larsson garazdawi@REDACTED
Mon Feb 18 15:16:49 CET 2019


On Mon, Feb 18, 2019 at 3:06 PM Dániel Szoboszlay <dszoboszlay@REDACTED>
wrote:

> On Mon, 18 Feb 2019 at 14:15 Lukas Larsson <lukas@REDACTED> wrote:
>
>> No need to restart the node, the same effect should be possible to
>> achieve by deleting the table and re-creating it.
>>
>
> Yes, that's true. I was just thinking that restarting the node is more
> practical, because that's a scenario all applications shall support. On the
> other hand re-creating a single ETS table from scratch on a running node is
> a feature that would have to be developed and tested a lot before doing it
> in production.
>

Indeed it does add a bit of testing. We have talked about adding an
ets:rename variant that replaces the new name atomically for this type of
operations.

Though I suppose the new modern world you could implement that yourself by
using persistent term. Just be careful with the inherent cost of replacing
values in the pts (persistent term store). Though if the alternative is a
node restart, it may be worth doing a global GC once a day in a live system.


>
> Daniel
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190218/381a6422/attachment.htm>


More information about the erlang-questions mailing list