On Thu, Mar 20, 2014 at 6:47 PM, Mike Dean <[email protected]> wrote: > Michael, Denys, > > I'm sorry; it seems you don't understand. I wasn't referring to depending > on gcc to do the linking for you, but rather doing it yourselves. I'm aware > that you guys are used to depending on compilers, linkers and the kernel to > do the hard work for you, but really, it's not that tough to do. There's no > reason you would have to load init code just because the busybox process was > started. You load that on demand, not by default.
In fact I don't understand what "init code" you are talking about. > That way, you don't > waste memory by loading init code that has nothing to do with the task > busybox was launched to perform. The text pages (pages contaning machine code) are read-only, and on MMU architectures they are shared. Meaning, in fact there is only one copy of each text page in RAM even if I run a thousand of busybox processes; and if there is memory pressure, kernel will find least used text pages and unmap them, freeing RAM for other use - because if they will be needed again, they can be read back from filesystem. IOW, for all intents and purposes RAM consumption by code can't be reduced by "unloading parts of code by hand" - kernel already does almost everything possible in that area. _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
