issue130:labolinux1
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue130:labolinux1 [2018/02/24 12:08] – créée auntiee | issue130:labolinux1 [2018/03/01 16:43] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Last month, I retweeted a link to an It’s FOSS article by Abhishek Prakash on How Much Swap Should You Use in Linux? https:// | + | ===== 1 ===== |
+ | |||
+ | **Last month, I retweeted a link to an It’s FOSS article by Abhishek Prakash on How Much Swap Should You Use in Linux? https:// | ||
This article got me wondering about how much RAM and swap would I use on an average day at work? A few details about my work machine: Intel Core i7-3770 @ 3.9GHz, 28GB RAM, Intel 530 180GB SSD + Seagate ST1000DM003 1TB hard drive. | This article got me wondering about how much RAM and swap would I use on an average day at work? A few details about my work machine: Intel Core i7-3770 @ 3.9GHz, 28GB RAM, Intel 530 180GB SSD + Seagate ST1000DM003 1TB hard drive. | ||
For the test, I ran Linux Mint Cinnamon 18.3 – with the latest updates. I started by rebooting the machine to eliminate anything that might be running in memory. At the LightDM login prompt, I switched to a virtual terminal and ran cat / | For the test, I ran Linux Mint Cinnamon 18.3 – with the latest updates. I started by rebooting the machine to eliminate anything that might be running in memory. At the LightDM login prompt, I switched to a virtual terminal and ran cat / | ||
+ | |||
+ | MemFree 28,225,148 kB | ||
+ | SwapFree 23,999,484 kB** | ||
+ | |||
+ | Le mois dernier, j'ai retweeté un lien vers un article d' | ||
+ | |||
+ | L' | ||
+ | |||
+ | J'ai choisi Linux Mint Cinnamon 18.3 avec les dernières mises à jour pour le test. J'ai commencé par redémarrer la machine afin d' | ||
MemFree 28,225,148 kB | MemFree 28,225,148 kB | ||
SwapFree 23,999,484 kB | SwapFree 23,999,484 kB | ||
- | Before going further, it’s worth mentioning that at no time during the testing did SwapFree ever change. This seems to confirm Abhishek’s theory that, with a lot of RAM, you might not ever touch swap space. | + | ===== 2 ===== |
+ | |||
+ | **Before going further, it’s worth mentioning that at no time during the testing did SwapFree ever change. This seems to confirm Abhishek’s theory that, with a lot of RAM, you might not ever touch swap space. | ||
I started by logging in and loading the Cinnamon desktop. I had my phone connected to my PC in charging mode (since boot), but nothing else was running. I ran the same cat / | I started by logging in and loading the Cinnamon desktop. I had my phone connected to my PC in charging mode (since boot), but nothing else was running. I ran the same cat / | ||
Ligne 15: | Ligne 28: | ||
Just over 472,308 kB difference. Firefox is undoubtedly one of the most used applications on Ubuntu, so I started by launching it. I’d heard in the past that Firefox tends to “leak” RAM. With Firefox launched and sitting at the default page, RAM usage was as follows: | Just over 472,308 kB difference. Firefox is undoubtedly one of the most used applications on Ubuntu, so I started by launching it. I’d heard in the past that Firefox tends to “leak” RAM. With Firefox launched and sitting at the default page, RAM usage was as follows: | ||
+ | |||
+ | MemFree 27,183,420 kB** | ||
+ | |||
+ | Avant de continuer, cela vaut le coup de noter que SwapFree n'a changé à aucun moment du test. Ceci semble confirmer la théorie d' | ||
+ | |||
+ | J'ai commencé par me connecter, puis charger le bureau Cinnamon. Depuis le démarrage, mon téléphone était connecté au PC en mode Charger uniquement, mais rien d' | ||
+ | |||
+ | MemFree 27,752,840 kB | ||
+ | |||
+ | Un peu plus de 472.308 kB de différence. Firefox est, sans aucun doute, l'une des applications les plus utilisées sous Ubuntu ; aussi, j'ai commencé par le lancer. J' | ||
MemFree 27,183,420 kB | MemFree 27,183,420 kB | ||
- | This is a 1,041,728 kB difference. On a system with 28GB of RAM, this difference is barely noticable, but on a system with only 2GB of RAM, the RAM available to the rest of the applications and operating system is already significantly reduced. Keeping in mind that a little less than half of that number is the Cinnamon desktop, it’s an argument for using a lighter-weight desktop like LXDE, iceWM, or Enlightenment - at least on older hardware. It also illustrates the fact that modern applications simply need a bit more RAM. | + | |
+ | ===== 3 ===== | ||
+ | |||
+ | **This is a 1,041,728 kB difference. On a system with 28GB of RAM, this difference is barely noticable, but on a system with only 2GB of RAM, the RAM available to the rest of the applications and operating system is already significantly reduced. Keeping in mind that a little less than half of that number is the Cinnamon desktop, it’s an argument for using a lighter-weight desktop like LXDE, iceWM, or Enlightenment - at least on older hardware. It also illustrates the fact that modern applications simply need a bit more RAM. | ||
Of course no one opens Firefox and just lets it sit at the home page. I opened 5 tabs with the following web pages: my own blog (some photos, no videos), the Full Circle Magazine website, Slashdot (remember when that was a thing), Distrowatch, | Of course no one opens Firefox and just lets it sit at the home page. I opened 5 tabs with the following web pages: my own blog (some photos, no videos), the Full Circle Magazine website, Slashdot (remember when that was a thing), Distrowatch, | ||
Ligne 28: | Ligne 54: | ||
MemFree 26,736,172 kB | MemFree 26,736,172 kB | ||
- | In other words, Yahoo by itself takes 447,248 kB, roughly the equivalent of 3-4 tabs. I picked Yahoo on purpose because I see a lot of people using Yahoo as a starting page (or for email). I’m not sure why people pick such a heavy site as a home page in this day and age, but it still seems to be relevant for some people. | + | In other words, Yahoo by itself takes 447,248 kB, roughly the equivalent of 3-4 tabs. I picked Yahoo on purpose because I see a lot of people using Yahoo as a starting page (or for email). I’m not sure why people pick such a heavy site as a home page in this day and age, but it still seems to be relevant for some people.** |
- | Earlier in the article, I mentioned that I had heard Firefox “leaks” memory. It seems reasonable to assume that all the RAM doesn’t get flushed when you simply close an application. On closing Firefox the amount of RAM available was: | + | Il s'agit d'une différence de 1.041.728 kB. Sur un système ayant 28 Go de RAM, cette différence ne se remarque à peine, mais sur un système avec seulement 2 Go de RAM, la RAM disponible pour les autres applications et le système d' |
+ | |||
+ | Bien entendu, personne n' | ||
+ | |||
+ | MemFree 26,620,820 kB | ||
+ | |||
+ | Gardez à l' | ||
+ | |||
+ | MemFree 26,736,172 kB | ||
+ | |||
+ | Autrement dit, il faut à Yahoo seul 447.248 kB de mémoire, environ l' | ||
+ | |||
+ | ===== 4 ===== | ||
+ | |||
+ | **Earlier in the article, I mentioned that I had heard Firefox “leaks” memory. It seems reasonable to assume that all the RAM doesn’t get flushed when you simply close an application. On closing Firefox the amount of RAM available was: | ||
MemFree 27,452,500 | MemFree 27,452,500 | ||
Ligne 41: | Ligne 81: | ||
I figured some might argue the point that other applications had already been loaded into RAM and this RAM was being used still by the residue of those applications so I rebooted the system once more, opened a virtual terminal, and ran cat / | I figured some might argue the point that other applications had already been loaded into RAM and this RAM was being used still by the residue of those applications so I rebooted the system once more, opened a virtual terminal, and ran cat / | ||
+ | |||
+ | MemFree 28,232,364 kB** | ||
+ | |||
+ | J'ai mentionné, plus haut dans l' | ||
+ | |||
+ | MemFree 27,452,500 | ||
+ | |||
+ | Quand je me suis connecté à Cinnamon au départ, la mémoire disponible était de 27.752.840 kB. Le chargement de Firefox avec plusieurs pages, puis sa fermeture semble avoir mangé 300.340 kB supplémentaires, | ||
+ | |||
+ | Bon. Quid de l' | ||
+ | |||
+ | MemFree 27,024,536 kB | ||
+ | |||
+ | Je me suis dit que certains pourraient soulever l' | ||
MemFree 28,232,364 kB | MemFree 28,232,364 kB | ||
- | I loaded up Google Chrome to the default page and ran cat / | + | ===== 5 ===== |
+ | |||
+ | **I loaded up Google Chrome to the default page and ran cat / | ||
MemFree 27,324,268 kB | MemFree 27,324,268 kB | ||
Ligne 55: | Ligne 111: | ||
On a machine with only 2GB of RAM, we would be well into the land of swap (2,871,800 kB), but, on this work machine, the RAM usage barely registers a blip. I closed all applications except VLC (which was still streaming audio) and memory usage dropped: | On a machine with only 2GB of RAM, we would be well into the land of swap (2,871,800 kB), but, on this work machine, the RAM usage barely registers a blip. I closed all applications except VLC (which was still streaming audio) and memory usage dropped: | ||
+ | |||
+ | MemFree 26,392,388 kB** | ||
+ | |||
+ | J'ai chargé Google Chrome (la page d' | ||
+ | |||
+ | MemFree 27,324,268 kB | ||
+ | |||
+ | En fait, Google Chrome semble utiliser légèrement moins de mémoire (que Firefox) : 908.096 kB, lorsque la page d' | ||
+ | |||
+ | Avant de redémarrer pour tester Chrome, j'ai décidé de tester l' | ||
+ | |||
+ | MemFree 25,353,268 kB | ||
+ | |||
+ | Sur une machine n' | ||
MemFree 26,392,388 kB | MemFree 26,392,388 kB | ||
- | At this point, I wondered if the issue was VLC or whether it was all remnants of Firefox and the other applications? | + | ===== 6 ===== |
+ | |||
+ | **At this point, I wondered if the issue was VLC or whether it was all remnants of Firefox and the other applications? | ||
I found an article on Techmint on How to Clear RAM Memory Cache, Buffer and Swap Space on Linux at https:// | I found an article on Techmint on How to Clear RAM Memory Cache, Buffer and Swap Space on Linux at https:// | ||
Ligne 64: | Ligne 136: | ||
The Techmint article outlines the way to clear PageCache, dentries, and inodes, and all three together, but it doesn’t really outline what dentries and inodes are, though it does warn not to clear dentries and inodes on a production server. To clear only PageCache, the article suggests running (as root): | The Techmint article outlines the way to clear PageCache, dentries, and inodes, and all three together, but it doesn’t really outline what dentries and inodes are, though it does warn not to clear dentries and inodes on a production server. To clear only PageCache, the article suggests running (as root): | ||
- | sync; echo 1 > / | + | sync; echo 1 > / |
+ | |||
+ | À ce stade, je me demandais si le problème était VLC ou si ce n' | ||
+ | |||
+ | J'ai trouvé un article sur Tecmint sur Comment vider le cache de ram, le tampon et le swap sous Linux ici : | ||
+ | https:// | ||
+ | |||
+ | L' | ||
+ | |||
+ | sync; echo 1 > / | ||
+ | |||
+ | ===== 7 ===== | ||
- | It’s worth mentioning that I tried running this command using sudo and it didn’t work, you must actually log in as the root user, which you can do by typing: | + | **It’s worth mentioning that I tried running this command using sudo and it didn’t work, you must actually log in as the root user, which you can do by typing: |
sudo su - | sudo su - | ||
Ligne 77: | Ligne 160: | ||
At this point, I still had VLC streaming the same radio station. The freed up memory result was surprising: | At this point, I still had VLC streaming the same radio station. The freed up memory result was surprising: | ||
+ | |||
+ | MemFree 27,475,792 kB** | ||
+ | |||
+ | Ça vaut le coup de noter que j'ai essayé de lancer cette commande avec sudo, mais c' | ||
+ | |||
+ | sudo su - | ||
+ | |||
+ | Après avoir exécuté « sudo su - » et saisi votre mot de passe (du moment où vous appartenez au groupe qui peut utiliser sudo), vous verrez l' | ||
+ | |||
+ | sync; echo 3 > / | ||
+ | |||
+ | À nouveau, ne jamais le lancer sur un serveur de production. Pour une meilleure idée de ce que sont les entrées de répertoires, | ||
+ | |||
+ | Maintenant, il ne restait que VLC qui continuait à faire du streaming audio de la même station radio. Le résultat de la mémoire libérée était étonnant : | ||
MemFree 27,475,792 kB | MemFree 27,475,792 kB | ||
- | It’s a bit more memory used than when we first logged into the Cinnamon desktop, but it does appear to free up a significant amount of memory (1,083,404 kB). This seems to indicate that VLC was using just 277,048 kB more RAM than when we first logged in. VLC continued to stream in the background while I checked the RAM usage. | + | ===== 8 ===== |
- | What does this all mean? It seems to mean that applications do “leak” RAM, and, even if you’ve closed an application completely, there may still be some residual RAM usage. When using a web browser, it’s much like using any other application that loads a lot of data; a single large file, or web page, may use up a lot of RAM compared | + | **It’s a bit more memory used than when we first logged into the Cinnamon desktop, but it does appear to free up a significant amount |
+ | What does this all mean? It seems to mean that applications do “leak” RAM, and, even if you’ve closed an application completely, there may still be some residual RAM usage. When using a web browser, it’s much like using any other application that loads a lot of data; a single large file, or web page, may use up a lot of RAM compared to many smaller pages/ | ||
+ | Un peu plus de mémoire est utilisée par rapport à ma première connexion au bureau Cinnamon, mais, en effet, cela paraît libérer une quantité significative de mémoire (1.083.404 kB). Cela semble indiquer que VLC n' | ||
+ | Quelle est la signification de tout ceci ? Il semble signifier qu'en fait les applications laissent « fuiter » la RAM et que, même si vous avez fermé une application complètement, | ||
+ | ===== 9 ===== | ||
- | Links of Interest: | + | **Links of Interest: |
Bruce Fields’ Virtual File System article: http:// | Bruce Fields’ Virtual File System article: http:// | ||
Ligne 94: | Ligne 195: | ||
Techmint - How to Clear RAM Memory Cache, Buffer and Swap Space on Linux: https:// | Techmint - How to Clear RAM Memory Cache, Buffer and Swap Space on Linux: https:// | ||
- | It’s FOSS - How Much Swap Should You Use in Linux? https:// | + | It’s FOSS - How Much Swap Should You Use in Linux? https:// |
+ | |||
+ | Liens intéressants : | ||
+ | |||
+ | L' | ||
+ | |||
+ | Tecmint - Comment vider les cache, tampon et swap de la mémoire RAM sur Linux : https:// | ||
+ | |||
+ | It's FOSS - Quelle quantité de swap sous Linux ? https:// |
issue130/labolinux1.1519470480.txt.gz · Dernière modification : 2018/02/24 12:08 de auntiee