Computer block by high ram usage (SWAP saturated)

I'm starting to get really tired of the problems with the high RAM usage, which blocks entirely my computers when it happens and so this is very dangerous for the data integrity

I would like to know how many of you suffer these issues?

In short, basically the 95% of the cause of this problem is by the damn-bloated browsers, they have even memory leaks with some websites until you restart them

Personally, I have 8 GB of ram in my computers, it should suffice for anything (except for browsers), but the thing is, how many people has at least 8 GB ? my computer's mom has only 1 GB, she can only open 1 web page at time, if she opens 2, computer's blocked

So I'm writing now a tool for now for my personal use, which will detect high ram usage and will also kill the browsers if reach 90%, that's much safer than lose the entire computer control and force a reboot (specially with those unreliable filesystems), maybe if this tool becomes good I could implement it by default in Elive :thinking: (inside an elive daemon which takes care about the processes health)

The funny thing is that it looks like that in windows (10), there's no issues with browsers :thinking:, anybody with more experience (usage) in that inoperating system can do a comparison comment?

My personal thinking about all that issue is that linux manages extremely bad the SWAP concept, it never worked as a reliable or useful thing for me, in short:

  • if you enable it, you feel your desktop lagged (at least in e16), because data needes to be re-fetch everytime from disk instead of ram (wrong place location of important data like a desktop-app?)
  • if you enable it, it won't save you from a block, in fact the kernel should kill the huge-consuming processes when it blocks the ram full (it was not the case recently), instead, swap will block your computer by saturation
  • it looks like the data is not even saved in a minimally-linear way, when an application needs to fetch the data from swap you can hear the strong fragmentation on disks, making the reading extremely slow and so your system saturated
  • it is not wise to know what memory should be "parked" and which one should be used, one thing is a loaded app in ram and another thing is a loaded secondary data

mentions: @triantares @Rebel450 @yoda @stoppy98

Generally speaking I have no real issues but then I too have 8gb ram. If I feel the machine is slowing down I open "top” and kill some buggers (usually browser).
i was surprised to see my daughter have Chromium open with at least 20 tabs with no problems on E16 on her 8g ram tablet. :thinking:


On the eeepc 1001px, with 2Gb ram, it's more the cpu going 100% that limit browsers (I use here mainly firefox & yandex) with 6-7 tabs for Firefox and 2-5 for Yandex (off course not that fast, but generally with no freeze...
For the eeepc 1015pn, same amount of memory but 2x more cpu + bit more MHz, it's quite comfortable...


1 Like

20 tabs can be possible if these tabs "doesn't consume much", but sometimes 10 can block the computer, I have also an extension so save memory by suspending unneeded tabs which works pretty well

@triantares its funny that you are "able" to kill buggers, normally for me, when I feel a lag is too later, the entire computer is so saturated that I cannot do anything at all (this happens with both a SWAP enabled from a mechanical disk and NO-SWAP mode)

1 Like

If it comes that far (luckily not often) and i have stuff I need saving, I hit the key combo for TTY-1 and just let it sit there until it shows up. Then login and top. :madness:
Note: I only use SSD drives lately, the mech ones always have issues lately.
My old thinkpad X41T has 4g and a mech disk. I'll test if I get a chance.
But then that one only works well with.Stable.

1 Like

This reminds on older Mac days;
there was an app called "zapram" (self explaining, methinks)

8GB RAM is usually enough for an average usage - BUT YOU
you are a developer and programmer annnd you surf with lots of open tabs. (is there a possibility to reserve more memory for the browser on Linux - somehow .... just an idea)
The company am working for has own developers in the office,
they are working with C++, Assembler, but mainly Java (framework) -
their machines are equipped with at least ! 64GB RAM, most of them 128RAM (!) :omfg:
and those are still complaining...

Coming back to the root of your question:
No, most of my machines has 4GB RAM, I do not encounter Memory problems at all, (big swap on SSD installed, but rare in use by the system; sometimes 6MB used)
But I do not have more than 6 tabs open (Firefox is my main browser)

Therefor I suspect that your OS is not freeing former used memory
(I know this phenomena from older OS X issues)
Is it an idea for you :confusing:

Is it a 5150? What about the computer's grandma? s/360? (I'm just joking ofc :boogie: :excited:)

I ran fine on 2 gigs, but i admit i had also an ssd which meant a really quick swap. With 3 gigs now everything is smooth. 1 gig is really too little nowadays... you cannot browse with 1 gig. Is like having a pentium III: it woud be smooth but you cannot open a browser (the bare minimum is a P4 HT).

It happened to me only when having to swap on a old hdd. With a decent hdd you may even be able to reach for the X and close the faulty extra app the filled the System Ram, but when having an old (and maybe even overused) one it's a pain. Though i never got to a full crash. In 2017 it was barely usable a system with 1 gb. 1.5gb was kinda ok. Now is probably impossible.

1gb in windows 10 is completely unusable. 2 gb are kinda usable but you cannot ask too much to a system. And again, you need at least a fast emmc. Anyway i'm pretty much sure about the fact window's ram management is kinda better than in any linux distribution i tried: look at it, is bloated AF but still usable on such low ram devices (with some tricks ofc). Some how instead most linuxdistribution when running out of ram are just stuck, feeling like the files choosen for the swap rather than the main memory are not the best ones. I guess you must get something slightly smarter when you pay a lot for it.

YEAH EXACTLY WHAT I WAS THINKING! If you swap you're dead, unless you have an ssd.

It feels like the swapping system does not follow any priority logic. For example when it happened to my 1.5gb computer and i had to swap on his old ide hdd, The first thing slowing down was the latest app i opened, like: the os filled the main memory so just moved to the virtual one rather than moving the background apps out.

Thought i think you kinda complain too much about the 8 gigs. I often times open 10-15 tabs when studying on this pc (that until 1 hour ago had 2 gigs). 8 gigs are enough for any basic usage nowadays, i completed an university project on my core2 duo laptop with 8 gigs and never even nearly reached the threshold, despite i had eclipse (aka bugged cancer), several firefox tabs music and other stuff opened on multiple virtual desktop. How much stuff do you open???????? Note: when i'm programming i can open way more than 20 tabs on firefox. Maybe you're using chrome? Chrome is a cancer when comes to memory usage, i had a friend who thought his mac was getting too old and unusable due to updates (it got to the point that opening notepad took 30 seconds) and after several os reinstalls he found out that it was just chrome bloating everything up (and finally moved to firefox listening to the advice i gave him 6 months earlier).

If they're still complaining it means they are running some multi-user nuclear simulations (or that the ram is not the issue).

I really don't have time for that, when it starts to lag, one second later is entirely blocked :confused: , my only chance is a SUB combo on the kernel magic keys (sync, umount, reboot)

or limit, more exactly :slight_smile: since eats all the memory until block the entire computer

yeah, you said JAVA, which is probably named after the star wars being (jabba) eating RAM's :thinking: :thinking: :thinking: :eyepopping:

@Rebel450 thanks for the comments, probably all my problems are by the browser (i normally never have ram issues when i dont have it opened), and maybe sometimes an issue with a specific thing, about OS freeing memory, well, it should be done that way from the SWAP feature, but as I said, swap seems like not have been well designed :thinking: (imho)

yeah, that's what i feel :thinking:

old or new, for me swap always did the same, about the "full crash" what i meant is that im forced to do a forced shutdown (entirely blocked for more than 10 minutes, unable to proceed with anything). 2017? yeah that's not far ago :confused:

thats an important topic because the installer suggest to add it and it also includes it by default (auto partitioning), but reality is... is better to have it or to not have it? :thinking:

BTW there's the no-smart ugly code: linux/swap.h at master · torvalds/linux · GitHub

yes, chromium, hum... maybe i should try to use firefox for a while to compare

What about just playing around with swappiness?

Ah good question, I played a lot with this in the past without seeing much results, I had it set to 10 in the past as suggested on internet, but I was not able to experience / test with good results, maybe i need to play more again with it

Just checked my conf and its the same as used in Elive by default now (so no specific confs, only the defaults), which means that I (the one with these computers block) has the same settings as you* (the ones that doesn't have them)

sudo scite /etc/sysctl.d/swappiness.conf ; sudo sysctl --system

update: after to enable the second option of the file (as the well description includes) i don't feel a lag in my desktop anymore even if i have 400 MB used in swap... i will continue my tests so this is always relative of the moment, but in any case if is like this, this option should be enabled by default in elive to not provide lagginess when using swaps

1 Like

I enabled it too (set to 1, right?)

What about to connect an additional fast drive
( at least via USB 2, better 3)
and define it as cache disk
(via the options in 'gnome-disks') ?

I don't think the problem is the amount of swap, the problem is when it gets to swap in general (unless i misunderstood)

I agree. Like @stoppy98 already pointed out:
8Gb RAM is quite sufficient and in my cases, swap is hardly ever used.

Maybe a slight visual warning that RAM is in danger of being full, would suffice and offer to kill some running memory hog; i.e open "top” or one of it's derivatives. :thinking:

1 Like

I can't say my issues are related to RAM. I'm using different setups from 2GB RAM to 16GB RAM.

But I totally agree, browsers are the worst. Since the whole Desktop experience is moving to the browser (MS O365, Google Tools to name a few), the next step is maybe a 'EliveBrowser'?

The People are able to move from their mobile to their tablet, over the Laptop to the Desktop. Only open a browser and you'll have nearly the same experience, every time ... Welcome to the cloud.

But as far as I know, Elive should support lower systems, that will be thrown away, else. Users (areas?) that are using older systems are not gifted with the best internet. Am I right?
We in the 1st world can choose between an installed Office Suite and the Browser based alternative. I hate to being on tour and can't edit an excel file, because my company is based on any cloud solution and blocked to store files on the host.

I don't think we can avoid the users from want using Facebook, LinkedIn, TickToc, Instagram ... on any machine. Maybe we could help saving RAM by use the user-string and provide the mobile versions?


tha funny fact is that some desktop versions are simpler than the phone one but still using more resources (e.g. Instagram). Though, the mobile applications use A LOT of cached files (between 3 and 6 gb for facebook/instagram). What about, for these having a virtualization support, almost anybody since my 2005 desktop pc supports AMD-V already, running the android apps within some kind of docker? would it be possible? There are already lighter apps alternatives for phones (like facebook light and stuff).

Ah yes and in comparison I remember my Palm Treo phone.
It did everything all current smartphones do but on severely lighter hardware specs (not weight tho :smile:) and very much smaller apps.
It was a joy to see palm-devs code and how they did their best to keep everything to the absolute minimum.
On top battery time was multiple times longer than any current smart phone. :happy_dance:


unlike software now. Lecturers often times even teach "if it works fine and the client doesn't pay you more, tell him to get better hardware. Optimizing is a waste of time". Or "caring about multithreading and multicore is a waste of time unless it is necessarily needed"

you may play with these things but i doubt you will have an improvement (which requires a verification from at least 1 week of working to make sure that is really better)

that's what I do with my swap, its on an internal mechanical extra disk (so which is not very used in I/O terms), in order to not waste the few GB of the SSD disk (which could be a faster option for sure)

In a funny way i read on internet a trick to use the GPU (graphic card) memory as a swap system :eyepopping: :rofl2:

yes I think elive needs a feature like this, but no questions about the killing, it should be made automatically :slight_smile: most of the times users has no access / able to do it, so its better to just crash the browser or the graphical server in an extreme situation


welcome to the corrupted capitalist (monetary) world :expressionless: , open-source is a different way to do things but even it, is strongly manipulated by the monetary strings

For those who wants to experiment, I found these parameters to work pretty well, minimal lag and minor swap filling up:

vm.swappiness = 20
vm.vfs_cache_pressure = 500

1 Like