4

Ask HN: Is 8gb RAM enough for a Linux dev laptop?

 1 year ago
source link: https://news.ycombinator.com/item?id=34452455
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Ask HN: Is 8gb RAM enough for a Linux dev laptop?

Ask HN: Is 8gb RAM enough for a Linux dev laptop?
12 points by herodoturtle 1 hour ago | hide | past | favorite | 29 comments
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.

With laptops (and few other things), I have a personal rule: It's better to spend a bit more and enjoy it than save money and suffer it. Having said that, if your budget is that tight and there's no possibility of saving a bit more in a reasonable amount of time, I would go for the 8GB version *only* if the model allows to upgrade the RAM, then, months later, after saving a bit of more money again, purchase more RAM and add it. If the model is one of those where the RAM is soldered, I wouldn't even bother.
Question. Why a laptop if you're plugging it into a monitor and therefore using it like a desktop?

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 of fixed areas of work they are far more cost effective than a laptop and actually allow for upgrading (RAM and SSD anyway, most 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.

No, it is not. That is enough for like 1 tab browsing a bank website to pay the bills. Maybe open 1 wikipedia tab.
8gb is enough, but I wouldn't buy a new laptop with 8gb unless I could update the ram in the future.
s.gif
This 100%!

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

It very much depends, but for a point of comparison:

With only 4GB, I have been mostly happy running:

  - Xfce
  - Firefox with thousands of tabs (most unloaded, and uBlock Origin installed!)
  - Postgres
  - Rails (one big app at a time)
  - Nginx
  - Slack desktop (Electron app)
  - tmux
  - vim as IDE, dozens of buffers, zero? plugins
  - zram for memory compression (kernel configuration.. this is critical)
  - Small (256GB) but quick SSD
  - Zero swap configured
  - Zero VMs locally!
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."

for the described usecase, that should be fine. I would recommend getting rid of desktop environment (gnome, kfce ...), go for i3 instead. and don't use display manager, gtty is what you need to log in to your system. that would save you lot of memory and space.
I would advise against 8GB, its really low even for lightweight work. You mention "dev' work: Imagine you have:

- few browser tabs

- 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)

8GB is probably enough to get by for most types of development, but personally I'd sacrifice some other spec on my computer (such as having the bare minimum HD space) to try and ensure that the RAM is at the normal level.
I've got a 4gb RAM pinebook pro, and use it as a dev laptop whenever I'm at my university, and didn't have any major problems. (Other than the missing vulkan support for the GPU, but I remedied that with swiftshader, oh and compiling llvm took very long, but thats not something I usually need to do)
I've been using a Macbook Air M1 with 8gb of ram to run a bunch of Chrome tabs, multiple iOS simulators, docker, an external display, plus the obligatory slack and zoom apps simultaneously and never ran into any issues. I assume most linux distributions would handle this even better than MacOS but anyone correct me if I'm wrong.
s.gif
macOS has memory compression active, does Linux by default?
s.gif
Depending on the distribution, yes. Fedora Linux does, for example.
It depends. If you only develop native command line programs it will more than be enough. But every Slack, Discord, Teams, webmail client, ... you got to have open will cut more into your RAM than you think. If the documentation you work with is not js ridden websites but man pages, txts or pdfs, your workflow allows you to occasionally close all tabs, and you do need to run software with big ram use on an ongoing basis you should be fine. However if those circumstances change you might need to upgrade: - by putting more RAM in the machine - moving parts of your workflow to a different machine and use laptop as "thin-client" - switch machines

At the moment my memory use with 16 GB looks like this:

      total   used    free   shared  buff/cache   available
Mem: 16167816 13526588 1017224 805552 1624004 1420060

Swap: 24838136 10326200 14511936

and i have not found a good way to account for where my memory goes.

Take 16gb at all costs. The time will come when you have to run some weird software stack in a VM taking up 4G. Additionally your IDE clocking in at 1-2GB and suddenly you find yourself at the limits. Saving here is not worth it.
Depends what you're developing.

I'd go for a lightweight desktop env like XFCE.

I run ElementaryOS 5.1 on a 2010 Thinkpad i5. It works fine for (basic) dev with vscode and javascript + nodejs stuff. I use Brave as a browser: much lighter than chrome. I tried to move to ElementaryOS 6 but it was slower.
I remember running OpenBSD on my laptop in the early 2000s at a total system memory use of 26MB.

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.

s.gif
I used sub-1gb dev laptop until ~2015. The only real problem was the web browser. A Firefox or a Chromium would eat at least 1gb of RAM just for showing a single tab. That was annoying. I came away not wanting more ram, but wanting a less burdensome web.
I’d look at refurbished laptops if you’re price sensitive. I’d rather have enough ram than a brand new system.
It is often much cheaper to upgrade than buy a package. Can you upgrade the ram later if you need to? I have a very old Thinkpad that I upgraded to 16gb ram some time ago and it works fine for everything I need, except editing gigapixel images (files sizes in multiple gb). I have a 64gb ram workstation for that.
If you have SSD you can pretty good use swap
16GB is the bare minimum for me these days. I recommend 32GB, but your mileage may vary.
s.gif
I'm curious, what are you doing that requited 32 gb of RAM?
As others have said, your best bet is to use some lightweight desktop environment. You may also want to switch Chrome for Firefox.

Also: can't you buy the 8 GB model and buy the extra RAM separately?

Yes, 8gb is enough to do dev with.

Although I suggest not using Chrome, but another Chromium browser that can sleep tabs by default, or Firefox instead.

I got an Intel 11th gen i5 quad core laptop with 16GB DDR4 ram for $110 recently. I only use it with external monitors at home. Here is the trick:
s.gif
Q: How do you keep a turkey in suspense?

A: ...

s.gif
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK