[eeps] [erlang-questions] New EEP: setrlimit(2) analogue for Erlang
Richard Carlsson
carlsson.richard@REDACTED
Tue Feb 12 10:45:06 CET 2013
On 2013-02-11 22:47, Kostis Sagonas wrote:
> The only remaining issue we are aware of has to do with code unloading:
> since terms in the constant pool of a module are not copied, as the
> vanilla system does, the code loader has to either preserve these terms
> or copy them on demand when a module is purged/reloaded. The OTP team
> has promised to look into this at some point but this work has not been
> prioritized yet. But the whole system should be usable without problems
> for all applications where unloading of modules with constants does not
> take place.
While trying to figure out the much harder problem of garbage collecting
globally shared constant pool data, couldn't you modify your copying
routine to just make an old-style non-sharing-preserving copy of the
subterms that belong to the constant pool?
Since you already check whether a pointer points to the local heap (the
common case), it should be cheap to add some extra check to the case of
pointers outside the heap. Possibly, you don't even have to do any extra
checking, just default to the old-style copying routines for all
off-heap subterms. This doesn't preserve sharing within constant terms
in modules when sent as messages, but at least would enable
sharing-preserving copying for all dynamic data. Or am I missing something?
/Richard
More information about the eeps
mailing list