Review Request 126161: OS X housekeeping

Alex Merry alex.merry at kde.org
Thu Nov 26 18:51:03 UTC 2015


On 2015-11-26 09:27, René J.V. Bertin wrote:
> There's something I don't really understand though: the exact same
> question you asked above.
> What's the difference between starting kwrite directly on the
> commandline (or through execve()), and dlopen'ing it? Why does the
> code go through that on Linux? Whatever that difference is, it's
> probably the reason why the approach fails on OS X.

If I recall rightly, it's a speed thing. kdeinit pre-loads some 
libraries common across most KDE applications (eg: Qt5Core and Qt5Gui, 
which are reasonably large). fork()+dlopen() can then make direct use of 
these already-loaded libraries, whereas an exec() would have to 
reload/remap them all.

I think there's also possibly some memory-usage benefits from the fact 
that fork() gives you copy-on-write access to kdeinit's memory pages.

Alex


More information about the Kde-frameworks-devel mailing list