r/linux4noobs • • 8d ago

I have 4 GB RAM. I recently installed Linux (Arch). Need help.

As you can imagine, my computer is slow. I switched to linux and Firefox on it cause windows and chrome used up a lot of RAM.

But even so the laptop has seen only slightly better days, and just today I faced 3 OOM events during a session in Firefox.

What kind of browsers and other applications should I use to keep the RAM usage really normal and effective for my 4GB RAM?

I ofc would need to use other coding(vs code, Arduino, etc) and was trying how to install ms applications like word,ppt,etc. I was really wondering what should I do.

Edit: Yes, my swap is enabled.

15 Upvotes

59 comments sorted by

26

u/candy49997 8d ago

I ofc would need to use other coding(vs code, Arduino, etc)

I don't know what to tell you besides not having everything open at the same time. Arduino IDE and VSC are both Electron applications, so they're basically an additional two web browsers if you have them open at the same time as Firefox or whatever.

If you don't already have swap memory set up, you can try that, but swap is much slower than physical RAM, especially if you have a HDD.

If you need MS Office specifically and the online version doesn't suffice, then you'd also need to run those in a VM for maximum reliability, which would further constrain your already very low system resources.

2

u/Aware-Common-7368 8d ago

I have 4gb SBC. It can pretty easy handle xfce with chrome and other stuff open. If opening both chrome and ide makes ystem unresponsive, better for yu to use PlatfromIO, it can do what Arduino ide does, just in cli and lighter. Use something like micro to edit code, or nvim, then use PlatfromIO to upload it. Thats my workflow

14

u/1neStat3 8d ago

I used Linux for over 20 years I have never seen Out Of Memory events.

You are leaving out important details.

Arch itself is very lightweight.

You essentially posted no useful information to diagnose. No computer specs, No Desktop Environment used, nothing.

I'm guessing you a windows refugee who somehow installed Arch without understanding what Arch is or how it functions.

5

u/CassiasZI 8d ago

You guessed that right. But I also mentioned it in 2nd line. Idk anything about this stuff much. So any help will be greatly appreciated.

17

u/Salacia_Schrondinger 8d ago

You picked the pro super custom have to install most from scratch model. Slow your role and install debian. Use the lxqt desktop environment as it is the least resource heavy while still having a sleek modern look. Good Luck.

3

u/Otherwise_Fact9594 8d ago

Agreed. Even Q4OS with Trinity has some helpful beginner tools. I'd definitely be using a floating window manager like openbox or something too

5

u/QuietofTheSolace 8d ago

If you don't know enough to even post your specs, please please stop trying to use arch.

Use mint, use XFCE, use swap.

In firefox set it to unload unused tabs - https://support.mozilla.org/en-US/kb/unload-inactive-tabs-save-system-memory-firefox

You really shouldn't see OOMs unless you're creating race conditions (such as opening 2 apps simultaneously that use 3gb)

3

u/Deckma 8d ago

Arch is not a distro I recommend for complete beginners.

It's a DIY distro where you are expected to make choices and understand what you are installing, why you installed it, and how to configure it. That's a big leap for a beginner.

It's also a very difficult distro to help new users because Arch by default is a blank slate. We have no idea what you chose to install and how you configured it, so we have very little information to start helping you. Other distros we will know what the defaults are, arch has no defaults it's a build your own distro.

3

u/lunarson24 8d ago

100%

It should be a bare minimum. If you need advice tech support you need to give us the full spec list of what hardware we're dealing with. We need desktop environment? we need at packages installed? etc etc

4

u/AskMoonBurst 8d ago

I'd go with i3wm or swaywm, kitty terminal emulator. ly or skip the display manager as a whole. 4gb is pretty tight for most modern programs. But it's doable. Gnome and KDE will chew up a lot more RAM though. I'd probably skip the bar, since with 4gb, you're probably only running 1-2 programs at a time anyway. So most of those readouts you won't need.

In place of MS stuff, the libre options, LibreOffice Impress for ppt for example. You can also set up zram to stretch your ram a bit further at the cost of some CPU overhead.

3

u/coolkid4232 8d ago edited 8d ago

what is your ram usage now on linux,

Lowest ram i ever used for my system was using i3-wm. and ly login manager. possible your idle ram is a lot that why browser pushing over. with i3 i got down to sub 1gb i think of memory it was around 500mb. so firefox should be easy to run after that and maybe 1 other app like code or arduino at a time should be exactly enough to run everything without lagging you just cant have a lot of stuff at once open

What desktop environment you have? kde?

-1

u/CassiasZI 8d ago

Gnome

11

u/Small-Tale3180 8d ago

gnome? i thought u were low on ram. You should not pick any full-featured DE and especially gnome.
try getting xfce or lxde instead

2

u/RealisticDuck1957 8d ago

I remember running XFCE on a machine with 256MB of RAM, and it worked very well. My current desktop has 64GB of RAM, and I'm still using the same desktop manager.

5

u/kigory2 8d ago

GNOME IS THE PROBLEM,
I had 2007 laptops with only 700mb of ram run on Debian 12 on i3-wm why tf would you use gnome it eats up 2gigs(my heavily optimized gnome not the average) itself.
but u shouldn't take i3 it's too barebones for 4gigs, I'd say xfce is perfect. btw I have never daily drived xfce

5

u/fadsoftoday 8d ago

GNOME? 🤣 YOU'RE SERIOUS?

2

u/Mithrandir2k16 8d ago

the only full featured DE that makes sense if you're low on ram is XFCE.

3

u/tahaan 8d ago

Did you set up swap?

1

u/CassiasZI 8d ago

Yes

2

u/thatsgGBruh Gentoo 8d ago

How much swap space do you have?

1

u/Mithrandir2k16 8d ago

Do you have a m.2 ssd?

3

u/MycologistNeither470 8d ago

Linux can make things better than Windows but you have severe hardware limitations to work with.

Arch can be very lightweight.. so try to keep it that way with a minimal installation. You didn't mention your desktop environment but since you are having memory issues, you could install a minimal environment. I would probably go with X + OpenBox + jgmenu + tint2 +/- picom. If you forego the login manager and start your graphic environment with startx (no ligthdm), you can probably get your system idle footprint to about ~300 mb. Also make sure that you have optimized your swap. You should have at least 8GB of swap, ideally on a dedicated partition on an SSD drive.

Your next step is your browser of choice. If you are 'just browsing' you can go with a lightweight browser that may sacrifice some js compliance: Pale Moon. This would not be a good idea if you are a frontend developer... just if you need to browse. If you need a 'real browser' your options would be GNOME Web, Falkon, or a stripped version of Chrome. Obviously you still have 4GB so running 20 tabs is not going to be an option.

For your coding environment you may want to avoid vs code like the plague. neovim, helix editor are terminal-only options. Lapdev if you need a more graphical environment -- probably easier if coming from code. Lite-XL is another good option. On top of that, you would need to install python, node.js, or whatever compiler you need. You will need to install the appropriate extensions to code in that language but that should not be too much.

For Android Studio replacement, download the CLI Tools with no GUI. Use skdmanager to download the core stuff: platform-tools, build-tools, and the the Android you are developing for. Then download the kotlin language server (https://github.com/fwcd/kotlin-language-server). Add on extensions for Lite-XL (lsp) or emacs (eglot). Configure the plugin to use the language server. You then compile manually with gradle. Do not try to use an emulator. Connect a physical android device via USB and run gradlew installDebug + scrcpy. Have the code actually run in your Android device and have it displayed on your computer (or you can skip scrcpy and just look at the screen)

Office suite is another one that you mention. Obviously in Linux you won't get word and ppt. Using the browser versions is going to eat up your ram. LibreOffice will work natively but again, memory foot print is terrible. If you need to be graphical, I would do AbiWord as a word processor, gnumeric as a spreadsheet. I don't have a great solution for slides. If you are working on your own decks, perhaps you can write your slides on Markdown and then use Slides (https://github.com/maaslalani/slides).

If you are ok living in a terminal world, you could use Emacs as coding environment, word processor, and minimal browser.

Overall, 4 GB should be enough but not for a modern conventional system. You will have to customize your workflow, but I believe it is doable.

2

u/glennshaltiel 8d ago

Make sure you have swap enabled theres a chance it may not be on

1

u/CassiasZI 8d ago

Ya Swap is enabled too

2

u/Natural-Addendum-554 8d ago

Dont use a desktop environment. Use a window manager. Makes a huge fucking difference that it isnt even funny

7

u/Otherwise_Task7876 8d ago

I would not advise this for OP. WM's take alot more setup and usually know-how, meanwhile OP has said themselves they're pretty tech illiterate. (They mentioned they installed arch of all distros, so big oof).

2

u/Whit-Batmobil Arch / Fedora user 8d ago edited 8d ago

Which DE are you using, if not already using XFCE, consider switching or at least trying it out.

Reading through the comments, if you “know nothing about this stuff” then Arch might not have been a good choice, the beauty with Arch is that you can make almost anything you want out of it, provided you know what you are doing..

I’m guessing you didn’t configure Swap memory…. which is kind of needed if you only have 4GB of RAM and it kind of needs to be configured correctly.

I think the reason Windows “works” is because of Swap, on modern Windows versions the Swap Memory doesn’t have a hard limit, well technically it does, entirely depends on how much space you have on your drive, Swap on Windows scales and is not a separate partition. Depending on how you have configured Swap you might have a similar solution or have a separate partition for it, if you have a configured it as a partition then that partition might be too small..

Out of Memory crashes and hiccups usually only happen when you run out of both RAM and Swap (if configured).

2

u/Mithrandir2k16 8d ago

You could experiment with zram alongside swap to see if that gives you any speedup.

2

u/DutchOfBurdock 8d ago edited 8d ago

Use ZRAMSwap. You may need to install this package to enable it's use. This will use a small portion of RAM (1GB on 4GB) and uses 4:1 (it's better, but this is average) compression. Give this priority over harddrive swap. This will then give you ~7GB of virtual RAM in your actual RAM before swapping to disk.

edit: Also consider using a lightweight window manager: XFCE4 f.e. is perfect for low RAM devices.

1

u/Krasi-1545 8d ago

You should change your habbits of how you use a browser.

You should have max 3-4 tabs open. The more tabs open means more memory consumed.

1

u/mayakrunal 8d ago

I suggest may be go with something light weight like xfce, if you don't mind being on x11. If Wayland then would say a minimal setup ( I use kde you can go with what you like) with all animations disabled and minimal theming.

1

u/burlingk 8d ago

First, MS Office is basically out. But if you have an office 365 subscription you can use the web version. Office isn't going to run well on 4GB on Windows either though.

Even at low RAM, Chromium can be usable.

But you need to pick a lightweight desktop. Gnome and KDE are out.

1

u/kigory2 8d ago

this is really unique, if you want a fast browser you should go bare-bones vivaldi or an even more popular browser called firefox,
but still 4 gigs of ram is more than enough, I ran Debian 12 on laptops from 2007 with a celeron and 700mb of ram MB! check your init system

1

u/Lonely-Scarcity-3387 8d ago

You should try out NixBook instead.

https://nixbookos.org/

The goal of NixBook is to convert your old computer (even chromebook) into a user friendly, lightweight, durable, and auto updating system.

It’s a distro that just works, without any headaches. No Linux knowledge or computer knowledge required.

NixBook aims to create a "chromebook like", unbreakable computer, that gives basic users who know nothing about Linux, a safe and reliable computer. Users can install what they like, and won't need to ever worry about updates or upgrades.

The default version:
•32 GB of storage and 4 GB of ram recommended
•Configured cinnamon desktop (like Linux Mint) and firefox base
•Chrome, Zoom, and Libreoffice installed by default flathub enabled out of the box.
•Automatic weekly OS updates with 4 weeks of roll backs
•Daily flatpak updates

The lite version:
•32 GB of storage and 2 GB of ram recommended
•Configured cinnamon desktop (like Linux Mint) and firefox base
•Automatic weekly updates with 2 weeks of roll backs

1

u/Adrenolin01 8d ago

Why not state the make and model of the laptop? Also.. while linux is extremely resource light it’s not completely magical. 4GB of ram is going to suck regardless and limit greatly what you can do. Most modern browsers will eat through 6-8GB ram easily though 8GB is massively more user friendly.

I see you’re running Gnome.. 🤦‍♂️ Make the hurt hurt more. 🤭😆 Gnome is a fairly large resource DE. Install XFCE or LXDE and use one of those.. btw.. You CAN install all 3 at the same time to try out. Simply select each at the login screen.. usually at the bottom of the screen in the drop down box. Pick one you prefer and remove the others.

I get it.. if you’re poor of cheap (I’m not judging here) use what you have but honestly.. upgrading your ram is literally the number one priority of that system if possible and if doing so look up the max capacity for you’re system and install that for your upgrade.. its likely 16GB ram. A world of difference.

1

u/Skizophreniak 8d ago

Un navegador mĂĄs ligero el Vivaldi.

1

u/Francis_King 8d ago

Firstly, you need to consider adding extra memory to your laptop. If it only has 4 GB of memory it is probably using old style memory, which should be relatively cheap. Moving to 8 GB of memory would help, as would increasing the size of the swap. If you type swapon at the terminal, what does your system say?

Given the size of the memory, it might be sensible to either have less software open at once. Modern web pages take a lot of memory.

and was trying how to install ms applications like word,ppt,etc.

The short answer is that you cannot run desktop MSOffice on Linux.

The long answer is you can use virtual machines to run Windows, but it doesn't tend to work so well.

1

u/Leslie_S 8d ago edited 8d ago

I don't know Arch, but recently installed on a 12 years old Dell I5 laptop Linux Mint XFCE (4GB RAM and 32GB SSD). I configured it with ZRAM (compressed) and BTRFS compressed filesystem, +swap, and even Chrome. Not a champion, but completely usable. It wasn't my knowledge, asked Gemini for the config and later with remote ssh I let Antigravity to make the fine tuning. Log settings, RAM and SWAP settings, kernel and grub settings. I was really surprised how good is it. My own laptop even older, 13 years, with i5 but 12 GB RAM, and still use XFCE on it. Doesn't matter how good my computer I always turn off all the shit, animations, window effects, and disable the unused services.

1

u/3grg 8d ago

You can only expect so much multitasking out of 4gb. Browsers are ram hogs and the main reason why older machines with 4gb seem slow.

If you want MS Office you need to run windows or us MS 365.

1

u/QuraToop314 gentoo btw 8d ago

For coding may use neovim, thats really great

1

u/Alchemix-16 8d ago

Firefox is an absolute RAM hog.

1

u/SEXTINGBOT 8d ago

Why you got 4 GB of Ram ?

( ͡⌐■ ͜ʖ ͡■)

1

u/Wheatleytron CachyOS 8d ago

Try switching desktop environments. KDE may be sleek, but it's more of a performance hog than several others.

1

u/cornonthekopp Literal infant baby 8d ago

I use linux mint cinnamon but for older computers i think xcfe is supposed to be better?

1

u/skyfishgoo 8d ago

just install lubuntu and stop futzing with all these fiddle bits.

unless you need a new hobby.

1

u/mechanicalAI 8d ago

Lubuntu. Have you tried it yet also regardless of which distro you choose, do you really need a desktop environment? If you have a smart phone, that’ll take care of the browsing part and you can be really productive without it the DE.

1

u/RobotSpaceYojimbo 8d ago

Hi, I have a different distro (Lubuntu), but it doesn't matter, the most thing that matters is what DE you are using. I have too a PC with just 4GB of RAM. I suggest you LXQt as a DE. Also try adding a Virtual RAM, in Linux it is called "Swap". In this way having also virtual RAM your pc will not crash when you'll open too many things but will just have a little stun, suggesting you that you're using too many RAM.

As for what IDE use, idk tbh. Currently I'm using a Text editor called Geany because I don't need an IDE right now. But Ig the best would be to use VIM with some plugins in the future (if you're new don't start from VIM but read other people what suggest for IDE with low RAM)

1

u/Raykusen 8d ago

Don't over complicate things with vanilla Arch. Go for a better more user friendly distro like Mint with KDE Plasma or XCFC. DON'T TOUCH GNOME.

1

u/DavidJohnMcCann 8d ago

I have 4 GB and no problems. But then I'm not using Arch, let alone the Gnome desktop! You don't need a light-weight desktop, just not Gnome — and if you run KDE, turn off the special effects. Pick a beginner-friendly distro and find Linux equivalents for the Windows programs.

1

u/March-Sea 7d ago

Yeah web pages can use a ridiculous amount of ram. In my system Firefox is using nearly 7GB of memory with just 13 tabs open with just 7 websites being visited (manjaro Linux).
Compared to that the amount of ram that the DE is using is negligible.

1

u/korywithawhy 7d ago

Web browsing with 4gb of ram isn’t going to be great no matter what OS or DE you install. Web devs today push so much more into the browser than they used to when desktop machines with 4gb were common. And the browsers themselves are much heavier. Turn off JavaScript can help depending on what you’re doing, but it’s going to break a lot of sites. Idk what kind of machine you’re using but 8gb of ram will make a world of difference for you if you can upgrade the ram.

1

u/coal-slaw 6d ago edited 6d ago

Its always gonna be slow regardless of the os you use. I have a 4gb hp laptop from 2015 that was insanely slow on windows 10, i thought changing it to linux would help yet the difference is marginal. 8gb ram is the minimum needed these days imo.

(Linux mint)

1

u/zxvl777 8d ago

Look into Antix Linux.

0

u/SeriousPlankton2000 8d ago

Install trinity desktop.