Skip to content

Fix two code unloading issues

Ben Gamari requested to merge wip/T24512 into master

First, don't unload code when profiling is enabled, fixing #24512 (closed). This patches up a blatant hole in the code unloading story as previously the heap census was not treated as a root set when determining object liveness. A more principle approach would be to instead trace the census, allowing us to retain some amount of unloading. However, in practice this would be of little value as the census will tend to keep most used objects alive until the profiling report is emitted at the end of execution.

While in the area, I also rework the unload check to account for platforms where mapping range information (e.g. from dlinfo) is not available (e.g. Alpine). On such platforms we cannot accurately determine object liveness and consequently should not unmap unloaded objects.

Merge request reports