Opened 5 years ago

Last modified 5 years ago

#755 new enhancement

Shared libraries should be shared in memory, too

Reported by: Jiri Svoboda Owned by:
Priority: major Milestone:
Component: helenos/unspecified Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:


HelenOS supports shared objects, namely libc, (on some architectures), which helps reducing disk consumption (e.g. size of the ISO) and to some degree memory consumption (by reducing size of the initial RAM disk).

However, the shared libraries get loaded into anonymous memory for each task, wasting RAM. We need to be able to actually map the files and make use of shared mapping to conserve RAM. This is especially useful when running on resource-limited HW.

This will likely require improvements to the memory management.

Change History (3)

comment:1 by Jiří Zárevúcky, 5 years ago

I'm not sure if actually memory mapping files is the right way to go here, despite that being the canonical solution in the *nix world. I was thinking that instead of allowing every task to search magic filesystem paths with their filthy paws, we could instead implement a dedicated library server that would provide and manage libraries. The library server would then share out the binary image, thereby avoiding the duplication, with no changes needed to the memory management.

comment:2 by Jiri Svoboda, 5 years ago

Thanks for the comment! I like your idea because it's simple, elegant, very HelenOS-like (Helenic?), and it even works without an MMU. The benefit of memory mapped files is, on the other hand, that pages can be loaded in a lazy manner, reducing startup time. I think you can easily combine both approaches, having the library server memory map the libraries instead of reading them. Either solution gets you memory savings. So I don't care much which gets implemented first, although the library server is probably the easier solution.

comment:3 by Jakub Jermář, 5 years ago

Milestone: 0.8.0
Note: See TracTickets for help on using tickets.