Ask HN: Is 8gb RAM enough for a Linux dev laptop?
New laptop, core i5, plugged into external 4K display, 5 to 10 chrome tabs, the odd full screen zoom meeting.
On a budget, and the 16gb option in my area (very remote) is more than double the price.
On a budget, and the 16gb option in my area (very remote) is more than double the price.
74 comments
[ 3.0 ms ] story [ 132 ms ] threadAs I sit here and type with one citrix session and two chrome tabs open, I'm using 16.91gb of heap.
My guess is that what is going on is that the internal storage is so fast that if it has to swap when switching tasks it doesn't really cause much slowdown, so that as long as each individual task can fit in memory during its time slice you are fine.
(Well...fine in the sense that it is almost as fast as a system with much more memory. But if I'm right it is also increasing the write load on the SSD and so lowering its lifetime, which those who want to use their computers for a long time might want to take into account).
I'd guess the same would happen on other operating systems and architectures if the SSD was fast enough.
Apple silicone memory bandwidth is like 100-200Gb/sec versus maybe 10Gb/sec for the ssd on a good day. Anyone can run on like a gig of heap, but nothing will be "fast", including apple silicone.
But most big processes don't need everything to be present in memory to resume. You just need to bring in the code and data that will be used in the short term.
10 GB in a second is 1 GB in 100 ms or 100 MB in 10 ms or 1 MB in 100 µs.
For many programs, especially GUI programs, you can maybe swap in enough for the main event loop and whatever is being actively worked on in a couple ms. Then as the user continues working you might have to spend another ms or so when they do something that needs code or data that wasn't already brought in.
rails / react / arc browser with tons of tabs, spotify, slack, vscode, obsidian, etc all open 24/7 and it feels as snappy if not snappier than my personal laptop. plus it's plugged into a 4k monitor.
i've been seriously impressed
A: ...
I recently bought a lot of two broken laptops, all Intel 11th gen for $160. One used exclusively for web browing, zoom, and slack. Another used for coding and building. 16GB each for total of 32GB ram. Use barrier to share mouse/kb between the two.
I'd go for a lightweight desktop env like XFCE.
At the moment my memory use with 16 GB looks like this:
Mem: 16167816 13526588 1017224 805552 1624004 1420060Swap: 24838136 10326200 14511936
and i have not found a good way to account for where my memory goes.
Note that buffered/cache is aggressively cached filesystem data that is as good as free/available with the Linux kernel.
Also: can't you buy the 8 GB model and buy the extra RAM separately?
Although I suggest not using Chrome, but another Chromium browser that can sleep tabs by default, or Firefox instead.
- few browser tabs
- IDE
- compilation
- maybe virtual machine or application under test running
its very easy to run out of RAM in this scenario, just parsing the source code and providing code completion can hang a pc these days. you can swap to disc but you will be hurting
if you buying 8GB is only option make sure the laptop has free RAM slot(s) so you can upgrade later
more tips:
- forget about GUI, look up i3
- if you can, install arch, or some other distro that lets you manually pick packages, if you go for ubuntu, be prepared to be disabling a lot of services after first install (not a huge pain, you can google how to do it)
Running Dillo instead of Firefox, vi (or vim) for coding, and twm as window manager. That was super low even back then. I think the only unavoidable memory hog nowadays is wanting to have many browser tabs open. And having a heavy IDE; VSCode is pretty cheap on resource use, but with LSP support you can really feel a difference with a better CPU and enough RAM.
Buying a new laptop should not only serve you today but also AT LEAST 2-3 years (more like 5y) down the road.
I'm still using my Late 2013 MBP (which I even bought second hand a year or two old) today - everyday. Unfortunately this one will need to get replaced soon as even with this build quality things starting to come apart or work suboptimal after almost 10 years. Hoping my next one is more repairable/upgradable (so probably no Apple) and last at least 5 years
With only 4GB, I have been mostly happy running:
If you are running Gnome, or Chrome, or Eclipse, or a big Java app, your experience will definitely be less good.My biggest consumers were Firefox and Slack. Restarting these apps nightly kept things under control.
I set this machine up as a temporary thing for a temporary project. It didn't turn out to be temporary, but it took me years to get around to migrating to a new machine, which I did just a few months ago. I was shocked at how "actually really OK" it turned out to be.
And this was with 4GB, not 8GB! So, I'd respond with "Yes, maybe."
Does it have to be a laptop? If you just want something portable you can take from place A to place B and use with a monitor have a look at mini PCs. They're smaller than a laptop (about the same weight) so you can pop it in your bag easily to move around if that is your need.
The only real limitation is you can't sit down in a coffee shop to work. But if you have a couple fixed areas of work they are far more cost effective than a laptop and actually allow for upgrading (RAM and SSD anyway, more than you get on most laptops these days).
FWIW I picked one up for my son a couple of months ago. It's a Ryzen 5600H with 32GB RAM and 500GB NVMe SSD. Runs Windows 11 and Fedora perfectly. Does a little gaming but is mostly for school work. Makes a solid little dev system though.
Not to mention it had perfect Linux support out of the box. Literally everything worked (wifi, bluetooth, both HDMI with 4k60, etc) whereas on a laptop it can be a real pain to get everything working right. You can avoid so many headaches going mini pc over laptop.
I like to do machine learning, which means no battery life, and even an bad old laptop nvidia gets you performance close to an M1.
And stay tf away from browsers.