You are not logged in.

#1 2018-04-03 10:30:12

teknosrp
Member
Registered: 2018-04-03
Posts: 5

Arch hangs when gets out of RAM

Hello

I have a computer with 1.5 Gb of RAM and a pentium 4 (64 bit) running Arch. The problem is that it it freezes when there are some programs opened at the same time and it becomes unresponsive. Hard disk activity indicator remains permanently lit and I am not even able to close anything, or to enter a tty. The only solution is waiting, but sometimes it doesn't work (or simply I can't wait an undetermined amount of time) and I force a power off keeping the button pressed and restarting the system

For example, today it happened with 3 tabs in pcmanfm, gmail and google opened in Firefox and about 5 simple spreadsheets in libreoffice. I know 1.5 Gb is not a huge amount, but I think it should be enough for this. Also I have a Swap partition with swappiness set to 60, so I don't understand why it happens.

Thanks for your help and sorry if there are mistakes in the text. I'm Spanish and I don't write English very well

Last edited by teknosrp (2018-04-03 10:31:13)

Offline

#2 2018-04-03 10:46:51

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Arch hangs when gets out of RAM

Only realistic solution to the problem is to dumpsterdive some newer hardware really.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2018-04-03 10:47:56

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,616

Re: Arch hangs when gets out of RAM

The only real way to fix lack of hardware resources is to increase those hardware resources, or adjusting your workflow to make do with the limited resources.

It's a borderline miracle Firefox even starts on this thing but it is guaranteed to consume all your RAM with the advanced gmail interface opened (you do use the more plain version I hope?). How simple are your 5 spreadsheets? Instead of "thinking" that it should be enough, look at top or similar and determine what is using up most of your RAM. Firefox is a likely candidate, try to use a more lightweight browser and use the GTK2 LibreOffice Theme.

Online

#4 2018-04-03 11:13:49

aja
Member
Registered: 2013-06-27
Posts: 26

Re: Arch hangs when gets out of RAM

If  you want to keep this hardware then Linux is not a good option for you , as I have noticed programs are not optimized and consume more resources than Windows ones, you should abandon Linux and switch to Windows XP and MS Office 2003 for your hardware type , I have Athlon X2 and 4 GB RAM and i have noticed similar issue, even if i press ctrl +alt + F2 ,, etc it does not work when RAM utilization is full.

Last edited by aja (2018-04-03 11:16:32)

Offline

#5 2018-04-03 11:20:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,514
Website

Re: Arch hangs when gets out of RAM

I have to disagree with all three of the above - not that getting better hardware wouldn't help, but it is certainly not the only option depending on what your goals are.

If your goal is to continue to run several programs including firefox with many tabs, then perhaps new hardware is the only option, but if you'd just like to avoid grinding to a halt when out of memory there are others.  Are you using swap?  If so, that's likely the cause of the slow-down/freeze.  If you disable swap, the OOM killer with "just" kill a process to free up memory.  It may not kill the process you want though (though I believe there are some steps you can do to bias the choice of which processes are killed first/last).

The result would be one or two programs would just be killed.  Admittedly that's not pleasant, but it is far better and far more efficient than waiting for thrashing to grind the system to a complete stop at which point you need to kill everything and reboot.

As for the last post saying linux could not run on such hardware well, that's just complete nonsense.  I *thought* they would say arch linux may not be the best choice, and that could be.  There are countless distros, though, that are optimized for low ram (where low ram is in hundreds of megabytes).  Arch's philosophy of "simple" is not the same as "minimal", our packages are actually quite bloated, though you can still opt for slimmer options: instead of firefox, use midori or some other browser.

Last edited by Trilby (2018-04-03 11:22:41)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2018-04-03 11:27:13

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Arch hangs when gets out of RAM

(GNU)/Linux itself will run just fine on the hardware, modern desktop programs might not.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#7 2018-04-03 11:31:09

aja
Member
Registered: 2013-06-27
Posts: 26

Re: Arch hangs when gets out of RAM

Hi Trilby,

Arch Linux may be optimized for low RAM ,but softwares like firefox ,libreoffice are not, hence the user should go with Windows XP and Office 2003, I have had similar issue and tried with swap and no swap, but when RAM usage is very high then system becomes unresponsive and i do not even have the option to kill running applications ,system hangs completely, I am even unable to  do ctrl +alt + F2/3 etc  to kill running apps.

Offline

#8 2018-04-03 11:38:16

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,514
Website

Re: Arch hangs when gets out of RAM

aja wrote:

Arch Linux may be optimized for low RAM

No, it isn't.  If by "may" you mean you could rebuild all packages and replace many core packages, then sure, it could be, but that'd no longer be arch linux.

aja wrote:

... but softwares like firefox ,libreoffice are not, hence the user should go with Windows XP

This is a complete non-sequitor.  You claim the OS is fine, but the user-space software is the problem (more or less true) but then you say the solution is to change the OS.  That is complete nonsense.  As for using MS Office as a replacement for firefox, that's plainly absurd.  If the probelm is firefox (which in large part it is) then the OP only needs to replace firefox.

I use linux (even arch) on lower-spec hardware than the OP's and have no problems at all with it configured as a normal desktop system - I just have midori for a browser, not firefox, xfce for a DE, not KDE/Gnome, etc.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2018-04-03 11:46:58

aja
Member
Registered: 2013-06-27
Posts: 26

Re: Arch hangs when gets out of RAM

We can install MS Office 2003 on linux using Wine but again it consumes more resources than installing it on XP, I would suggest going for IE11 instead of Firefox , you can kill apps easily in Windows XP when RAM usage becomes high , but in Linux it is difficult as the system becomes totally unresponsive ,again Midori does not work on all websites ,IE11 would be better.

Offline

#10 2018-04-03 11:51:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,514
Website

Re: Arch hangs when gets out of RAM

aja wrote:

We can install MS Office 2003 on linux using Wine

What the **** are you smoking?  This is in no way helpful to the OP nor relevant to this thread.  I'm done responding to you.

aja wrote:

Midori does not work on all websites ,IE11 would be better.

This has to be a belated april fools joke.

Last edited by Trilby (2018-04-03 11:53:43)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2018-04-03 11:53:16

aja
Member
Registered: 2013-06-27
Posts: 26

Re: Arch hangs when gets out of RAM

Cool your t!t$ man, if you get emotional and angry , it affects your health, I apologize if i made you angry and beg your forgiveness for my dumbness.

Offline

#12 2018-04-03 12:13:38

ray731
Member
Registered: 2018-01-27
Posts: 23

Re: Arch hangs when gets out of RAM

My Arch Openbox with opened Palemoon browser (10 tabs), Geany (12 tabs) and SpaceFM (7 tabs) takes 520 MB of RAM.

Last edited by ray731 (2018-04-03 12:15:26)

Offline

#13 2018-04-03 12:16:35

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,616

Re: Arch hangs when gets out of RAM

Try to stay on topic folks.

We don't know yet in which part the single pieces of software interact with each other, going to such drastic methods as completely replacing the OS is a rash proposition given the knowledge we have. There's a good chance libreoffice isn't as resource intensive and even then there are many other alternatives in this regard as well (abiword comes to mind)

Online

#14 2018-04-03 14:54:16

teknosrp
Member
Registered: 2018-04-03
Posts: 5

Re: Arch hangs when gets out of RAM

Trilby wrote:

I have to disagree with all three of the above - not that getting better hardware wouldn't help, but it is certainly not the only option depending on what your goals are.

If your goal is to continue to run several programs including firefox with many tabs, then perhaps new hardware is the only option, but if you'd just like to avoid grinding to a halt when out of memory there are others.  Are you using swap?  If so, that's likely the cause of the slow-down/freeze.  If you disable swap, the OOM killer with "just" kill a process to free up memory.  It may not kill the process you want though (though I believe there are some steps you can do to bias the choice of which processes are killed first/last).

The result would be one or two programs would just be killed.  Admittedly that's not pleasant, but it is far better and far more efficient than waiting for thrashing to grind the system to a complete stop at which point you need to kill everything and reboot.

As for the last post saying linux could not run on such hardware well, that's just complete nonsense.  I *thought* they would say arch linux may not be the best choice, and that could be.  There are countless distros, though, that are optimized for low ram (where low ram is in hundreds of megabytes).  Arch's philosophy of "simple" is not the same as "minimal", our packages are actually quite bloated, though you can still opt for slimmer options: instead of firefox, use midori or some other browser.

V1del wrote:

The only real way to fix lack of hardware resources is to increase those hardware resources, or adjusting your workflow to make do with the limited resources.

It's a borderline miracle Firefox even starts on this thing but it is guaranteed to consume all your RAM with the advanced gmail interface opened (you do use the more plain version I hope?). How simple are your 5 spreadsheets? Instead of "thinking" that it should be enough, look at top or similar and determine what is using up most of your RAM. Firefox is a likely candidate, try to use a more lightweight browser and use the GTK2 LibreOffice Theme.

Hello

I have tried setting swappiness to 0 but the problem was the same. I don't know if it was the correct way of disabling swap. Later I will try using swapoff and post the results.

I use LXDE and the system only takes about 250mb of RAM at startup, which I think is fairly good, but I don't understand how the system manages the remaining memory. For example, my Android phone has 1GB of RAM and I can have 100 tabs opened in Chrome. Obviously all of these pages can't be stored in memory, so when I access an "old" tab, it simply reloads. What I expect to happen on my computer is exactly the same. If there is not enough free memory for all tabs, I think the normal way to proceed is to remove the old ones from memory instead of taking down the entire system, and reload them when necessary. And in the same way, if the browser (or the program abusing from computer resources) is not able to manage them efficiently, it should be killed by the system.

I think there should be a way of setting this behavior in Arch.

ray731 wrote:

My Arch Openbox with opened Palemoon browser (10 tabs), Geany (12 tabs) and SpaceFM (7 tabs) takes 520 MB of RAM.

I didn't know Palemoon. I will try it instead of Firefox to see if it runs better.

Offline

#15 2018-04-03 15:22:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,514
Website

Re: Arch hangs when gets out of RAM

teknosrp wrote:

I have tried setting swappiness to 0 but the problem was the same. I don't know if it was the correct way of disabling swap.

No, that just changes which bits get swapped to disk first.

teknosrp wrote:

Later I will try using swapoff and post the results.

That is the correct way to disable swap.

teknosrp wrote:

my Android phone has 1GB of RAM and I can have 100 tabs opened in Chrome... What I expect to happen on my computer is exactly the same.

It will not be the same.  Chrome for Android is not the same as Firefox for desktops.  Chrome for android isn't even the same as Chrome for desktops.  They are completely different pieces of software designed with different priorities for different purposes.  You can definitely find browsers that are designed from the ground up for memory efficiency.  I gave the example of Midori for one - admittedly it's been a while since I used it, but working well on low-spec hardware has always been a priority of Midori development - this is absolutely not the case for Firefox.  Firefox has a lot going for it, but it is a beast of a browser.  The design goals for firefox seem more targetted at taking full advantage of modern hardware (and as a trade off, it pretty much sucks on older hardware).

teknosrp wrote:

If there is not enough free memory for all tabs, I think the normal way to proceed is to remove the old ones from memory instead of taking down the entire system...

Neither of these is quite right.  The kernel knows nothing about "tabs".  If you run out of memory and have no swap, the kernel will just kill some processes.  It will not close tabs, it may kill firefox entirely.  Or it might kill your WM, or your network manager, or some other thing you'd not expect that may not make much sense.  The OOM killer algorithm is not "smart", it just uses simple heuristics to find some process to kill.

teknosrp wrote:

I didn't know Palemoon. I will try it instead of Firefox to see if it runs better.

Palemoon is alright, but I don't know if I'd expect substantial differences from firefox for resource use.  But the nice thing about Linux is that you have *many* quality web browsers to chose from each with their own design goals.  There are quite a few that are designed for older and/or resource-limited hardware.  Try a few.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#16 2018-04-03 23:04:58

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: Arch hangs when gets out of RAM

Try increasing your swapiness to 100. The kernel will start swapping unused memory to swap sooner, leaving more available for running processes.  This may just delay your same problem though.

Offline

#17 2018-04-04 07:15:02

ray731
Member
Registered: 2018-01-27
Posts: 23

Re: Arch hangs when gets out of RAM

teknosrp wrote:

I use LXDE and the system only takes about 250mb of RAM at startup

Arch Openbox (with S6 init from Obarun) uses 115 MB of RAM at startup.

Offline

#18 2018-04-04 13:45:18

Jarhmander
Member
Registered: 2016-08-10
Posts: 7

Re: Arch hangs when gets out of RAM

fukawi2 wrote:

Try increasing your swapiness to 100. The kernel will start swapping unused memory to swap sooner, leaving more available for running processes.  This may just delay your same problem though.

I would not recommend putting the swapiness to 100: the kernel will aggressively put pages to swap, including application pages―when "code" is in swap, switching between programs become slow and unresponsive. Usually, for a desktop PC, the ideal is to put the swapiness to a low value, 10 or less. Then, the general consensus is to put vfs_cache_pressure to around 50, favoring inode/dentry cache over regular cache, and tweak dirty_bytes and dirty_background_bytes to a few megabytes. That will decrease the overall performance, but hopefully increase responsiveness, as program will not be swapped for data cache.

See on the Arch wiki for sysctl, this, and also this for relevant info.

Using an SSD will definitively help though.

Also, first post. Hi everyone!

Offline

#19 2018-04-05 01:21:17

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: Arch hangs when gets out of RAM

Jarhmander wrote:

Also, first post. Hi everyone!

Great first post, welcome and thanks for the info, TIL smile

Offline

#20 2018-04-05 11:58:05

sekret
Member
Registered: 2013-07-22
Posts: 284

Re: Arch hangs when gets out of RAM

I've been using swapiness 100 for quite some time, even on 1GB laptops and my system always performed better than with 0 or no swap. It's worth a try!

About the memory consumption of palemoon and firefox: Palemoon requires less memory, not substancial, but the difference is big enough to switch. It's a fine browser, however the addons are mostly EOL, which can be seen as a problem.
Midori uses webkit2gtk, which is a good sign.

The most important thing is to use a lightweight DE, ideally built by yourself, e.g. pure Openbox. I run a pure DWM, my system needs 120MB of ram after bootup, which is quite nice.

What about switching to 32bit? It's not supported by Archlinux anymore, but it's still there!

Offline

#21 2018-04-05 12:19:30

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,616

Re: Arch hangs when gets out of RAM

FWIW swappiness = 0 is yet another special case, so the minimum relevant test would be swappiness = 1 for the behaviour Jarhmander describes.

Online

#22 2018-04-05 12:36:10

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,806
Website

Re: Arch hangs when gets out of RAM

I've 4 gigs of ram and 3 gigs of swap on an ssd and  been rocking  these setting for a while

vm.swappiness=100
vm.vfs_cache_pressure=50
vm.dirty_background_ratio = 2
vm.dirty_ratio = 4
vm.page-cluster=16

It works really well, I don't experience any of that mysterious lag that most people believe happens when you set swap to some big value
In fact I can now run twice as many programs and tabs in my browser without my system going in thrashing mode. Of course swapping only happens when there's a problem contrary to popular belief that high swapping value will make your system swap for no reason.

Keep in mind that actively running code can't actually be swapped. Don't think it is some storage where you can just dump everything it is a lot more complicated than that.
Having 3 gigs of swap in my case I haven't actually seen my swap usage go higher above 1.7 gigs before the whole thing locking up and thrashing (because some stuff can't just get swapped out as I said)

My topic on the matter: https://bbs.archlinux.org/viewtopic.php?id=231265


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

#23 2018-04-11 01:43:18

Jarhmander
Member
Registered: 2016-08-10
Posts: 7

Re: Arch hangs when gets out of RAM

Oh, am I spreading misinformation? That's not so nice as a first post…

I tried your suggestion regarding swappiness on my work laptop, but hit a snag: it has 16G RAM and the swap is on an SSD. I practically never need swap, and it's so fast anyway. I must try it on my much more modest machines at home when I get the time… Also I must read about vm.page-cluster, I have no idea of what it does.

Thanks for the insight.

Offline

#24 2018-04-12 12:39:37

blackout
Member
Registered: 2014-05-21
Posts: 38

Re: Arch hangs when gets out of RAM

you can try Zswap

this is what I have done on tablets and notebooks with 2G Ram

yaourt -S systemd-swap
systemctl start systemd-swap
systemctl enable systemd-swap
cp /etc/systemd/swap.conf /etc/systemd/swap.conf.d/

and edit

sudo vim /etc/systemd/swap.conf.d/swap.conf

zswap_enabled=1
zswap_compressor=lz4hc
zswap_max_pool_percent=50 # try different values just increase number if you need more memory
zswap_zpool=zsmalloc

Last edited by blackout (2018-04-12 12:51:32)

Offline

Board footer

Powered by FluxBB