I would like to know what are the drawbacks of using preload
? If there would be no downside, preload
would be enabled by default, so I guess there are some.
Okay you need a bit more RAM, but most people have by far more RAM then Ubuntu needs - so what are the downsides of using preload
?
Simply put, Preload isn't for everyone. It is great if you open applications or libraries a lot. It is harmful if you load applications or libraries only occasionally. I will use two examples from my actual usage (and yes I use preload).
First, Google Chrome. Now a browser is opened only once per boot, maybe twice (for me, I am a web developer). Chrome and its related libraries stay in memory because I am always using it. Even when I close all the chrome windows it's still in the background doing its thing. Thus all the ram dedicated to holding a preload copy of Chrome is a total and utter waste. It's never (or rarely) unloaded. For the average user this is true for a great number of applications. A Office user will almost always have their email app open. So the small savings in startup time is completely wasted because they only open their email app once a day, and leave it open.
The Second example is rake. As a ruby developer that believes in testing I run rake a TON. rake runs, executes for a couple of seconds - minutes then exits. Preload helps me speed up my daily work because it loads rake and its needed libraries (which can be very extensive) ahead of time. So there are a lot of starts and stops to the running of rake. The extra ram used to speed up the 400 or 500 launches of rake over the span of a few hours is totally worth it.
So the reason it's not enabled by default is because its ability to actually improve performance is based largely on how you use your system. For some people it will be a negative and for others a positive.
Lastly, having preload on, even if you're not using it, consumes ram. So if you're not launching applications frequently, you could actually make your entire system fractionally slower by not having that ram available for other types of caching. Remember, even if you have 32 Gigs of ram Linux will try to use as much of it as it can to cache data to make your interaction faster. By using preload you reduce that free memory some. Even if it is just a little tiny bit, the 2 seconds you saved launching chrome 1 time could cost you 60 seconds over the month it stays running.
Now that being said, it seems that preload is a great utility, and it might be.
I think that the reason its not preloaded with the OS, is because the user has to know exactly what there doing, and have enough experience to be able to use it, and the system has to have enough RAM.
On a more technical aspect, preload works by moving data from the hard disk to RAM, which makes most hard disk to go to sleep mode if not used, and then have to spin back up when needed. So spinning up/down the drive, would cause the Load/Unload Cycle count, and the Power-On time count rise, and that will shorten the life of the drive.
1Source:techthrob
2Source:Preload - An Adaptive Prefetching Daemon by Behdad Esfahbod - A thesis submitted in conformity with the requirements for the degree of Master of Science - Graduate Department of Computer Science - University of Toronto Copyright (c) 2006 by Behdad Esfahbod.
Drawbacks? There are NONE!
Increased performance opening applications by the user. I have used it for years on my systems as well as "read-ahead" and have no issues. The bug page for preload doesn't suggest any drawbacks either.
Preload monitors applications that users run, and by analysing this data, predicts what applications users might run, and fetches those binaries and their dependencies into memory for faster startup times.
It does increase the boot time slightly however the speed decrease fetching time of applications far exceeds this little issue.
see article
If you're constantly using common apps like Firefox or Gimp you'll notice some greatly improved load times. Preload is a daemon that runs discretely in the background and will not disrupt your desktop in anyway. Ubuntu users can install preload with:
Results:
ref
Here are some drawbacks of Preload and why it is not that effective for everyone I do have a decent specification system with 8GB RAM. So my system is generally fast. Also, I will open heavy memory-consuming applications, such as Firefox, Chrome, VirtualBox, Gimp etc., one or two times per day. They remain open all the time, hence their binaries and libraries are preloaded into memory and occupying the RAM all day. I rarely close and open those applications, so the RAM usage is simply waste. If you’re using modern systems with SSD, Preload is obviously useless. Because SSDs access time is much faster than normal hard drives, so using Preload is pointless. Preload significantly affects the boot time. Because the more applications are preloaded into RAM, the longer it takes to get your system up and running.
You will only the see the real difference only if you’re reloading applications a LOT of time per day. So Preload will be ideal for the developers and testers who open and close the applications several times every day.
I think that preload does almost nothing. What it seems to do is to load all frequently accessed pages into RAM and locks them there so they stay there. The kernel does almost the same. It keeps
dirty pages
which are files that were used by a program (or are the program itself). If the program doesn't need those pages anymore, so itcloses
the file.... python:.... then the kernel will still keep them in the RAM and only overwrite those
dirty pages
if the RAM is ...% full.Preload only enhances the process but may even slow down the system. It loads applications into RAM but locks them so the kernel cannot release them if the RAM is full. Preload automatically releases them, too, but the kernel has to release the
dirty pages
before the pages locked by preload are released. Preload has to decide when the locked pages are released and so it can be a waste because if you have the browser opened all the time preload will lock it. Now you close the browser - preload will still lock it. You use all the RAM - preload will still lock it - and the kernel has to release the pages that are required at the moment. Because you don't want to browse anymore, you want to play a game. The game files have to be reloaded all the time because the kernel has to free it'sdirty pages
.I don't know how exactly preload works, how it is learning and how efficient it is, but it would bloat the system for not really anything. Preload can waste RAM. It can waste HDD resources (especially slow down boot I read). The user shall decide if he wants it or not. Preload can help a lot if you're rebooting your system a lot, but if it's in suspend-to-ram often you wont need it. There is no noticeable difference.
One thing: The kernel releases the oldest page if the threshold has been reached Preload releases the file/page that's the most unnecessary.
But as I said: if you don't do what you usually do preload can waste your RAM a lot. Like.. You are not gaming much but coding often. Preload will be a waste when you're gaming but not really when you're coding.
That's my view. It may be wrong or correct, keep what you think is good, ignore what you don't like.