Hacker News new | ask | show | jobs
by darrmit 2497 days ago
My experience is somewhat opposite. I love Linux. I've used it for over a decade in various roles. But it always ends up the same - either some obscure Bluetooth or graphics bug frustrates me to the point I can't stand it anymore, or I get fed up with 2 hours of battery life and go back to macOS.

In this case, I'm measuring my productivity by the time it takes to mess around with the OS to get the desired result, and the fact that the stability baseline just never seems to get there.

I get and support the attraction to Linux on the desktop, but find YMMV to be very much true.

9 comments

Yeah, this is exactly my experience too.

I try to move over every six months to a year or so, and it's the same gripes every time at this point.

Driver support's reasonable now, and the desktop environments are generally solid enough, but things like mixed DPI work really badly on Linux, my browser nearly always tears when scrolling on my secondary display, etc.

But... the single biggest killer for me though is how badly Linux copes with very low amounts of free memory. Put 32G in a machine and it still periodically runs completely out under my dev workload and when that happens, the whole system becomes unusable and I have to hard reboot it. I'm not sure what macOS and Windows do differently, but it just doesn't happen on either of those two OSes.

I really want to have the freedom to pick and choose my hardware more, but at the moment I keep falling back to macOS.

It's a UNIX environment so it has the tooling I want and a solid GUI that works well.

There are discussions happening on LKML right now about how to solve this. I don’t have a link handy, but saw them either here or on LWN recently.

I used to have that problem too, but it went away when I stopped using JetBrains products :). Not for any reason other than the contract I was working on ended.

Then I shall live in hope that it will be fixed :)

And I didn't even have a JetBrains product in the loop, it was a mix of virtualbox and VS code, along with browser, mail client, etc.

To elaborate a bit based on my understanding of the issue: VirtualBox seems like a great program to tickle the issue.

During a memory pressure scenario, the kernel starts looking around for things that it can get out of RAM to free up space. If swap is enabled and not saturated, paging out some data to disk is a likely option. Reducing disk cache size works too. But... when the usual candidates run out, things have to get more clever. Things like shared libraries can get paged out! If one of those pages is requested, it can be reloaded from disk. Or, in the VirtualBox case, the mmap'd disk image can be removed mostly from RAM and have those pages loaded from disk as needed. Performance sucks terribly, but it keeps trucking on.

The wrinkle in all of this is SSDs. The out-of-memory (OOM) killer heuristically watches the system and kills off processes that cause memory pressure problems. These heuristics, however, are expecting these page-in and page-out operations to be slow (as they were on HDDs). On newer SSDs, the disks are too fast to trip the OOM killer into action! This is why, when this problem manifests, your disk activity light goes on solid, even if you don't have swap enabled. The kernel is sitting there trying every trick in the book, and the OOM killer doesn't see what's happening. Every individual page fault is handled quickly, there's just waaaaaay too many of them.

Yep, this is an accurate description according to my understanding of the issue too.

The lesson I've recently learned is that, for now, swap is necessary on Linux machines with SSDs. I've enabled zswap and added a 4 GB swap file to my machine with 16 GB of RAM, and the problem hasn't reoccurred for me since then. Supposedly, the memory pressure measure in the kernel gets a more accurate reading when swap is enabled, but I don't know for sure that that's true. At the very least, you can page out the memory you're using the least instead of file-backed pages, which is what happens in memory pressure situations on SSDs (as opposed to OOM killing).

Wow, that's a really cool explanation. Although, I've had an SSD in my desktop for 8 years now, it's a bit sad to hear.
I saw it as more of a Java problem on Linux than a Jetbrains one with Android Studio.

When Android Studio is run with large code base on emulator, memory issues were frequent in Linux with halting issues. SO has several such cases.

No such issues with macOS, even with mutiple Jetbrains IDEs in parallel(Same memory config).

I wonder how Android Studio is doing on ChromeOS, considering many of those are low end machines. I'm sure they had to optimize it, but I assume the issue would persist till the Linux kernel itself is fixed.

Another alternative for people who still love macOS but can't tolerate the dumpster fire that is the butterfly keyboard is to get a new Mac Mini, then get a monitor of your choice and righteous clickety-clack buckling spring keyboard to go with it.
Seconding this, the Mini has really reduced my periodic urges to upgrade my 2013 MBP.
I find that for low RAM situations that zram is very handy and allows for a graceful reduction in performance under memory stress rather than a cliff edge that you get with a swap partition.
zram has been replaced with some other technology (z-something, can't remember the name) that also compresses swap and removed duplicate pages.
zswap?
And this is why many people like me stick to Mac. Yes there's a solution for it on Linux, but no I don't want to look for it, maintain it, and at some point when a new 'best solution' is available keep up to date with all that...
On Linux, the distributions do that for you. You don't have to, but if you want, you can.

On Mac, you can't, even if you want. So you won't see discussions like these, because Mac does not have that kind of visibility inside. If something is broken (and Mac has its share of broken things), you get to keep all the pieces.

I had the same issue. The solution I settled on (and have been very happy with) has been a Mac Mini as a polished front end/web browsing machine, and then a Threadripper workstation running Ubuntu that I ssh into and do all dev work on. The pleasure of OS X without being so limited by Apple’s hardware options (and extreme markup).
How big is your swapfile?
I'm really curious, what is your dev environment/setup like?
Have you tried earlyoom?
+1 to this as a workaround until the kernel finally addresses the issue. Earlyoom is a user space OOM-killer that kicks in before the system starts the mad paging dance.

https://github.com/rfjakob/earlyoom

Packages are available in Debian Stable (Buster), so they should be available in most child distros by now as well.

It seems likely that something can be done to make the behavior less perverse but I'm not convinced that the behavior CAN be better than something like earlyoom.

What makes earlyoom useful is the fact that you can tell the machine what is low value and likely to be problematic. I'm not sure that information can be determined automatically. I'm further not sure what a better strategy than start killing low value problematic processes when we reach a threshold looks like.

Do you have a swap partition?

I've been in a couple of interesting discussions about Linux memory management lately that enlightened me somewhat, and I won't claim to be an expert now, but I've been around the low-memory block enough to understand now that, there's no simple right answer to the question of "Do you have swap?"

"The Linux kernel has overcommit baked into the fiber of its being." I've begun to understand that this idea is so deeply engrained in the kernel that in a multi-tenant or desktop workstation, you simply can't extract it back out and "just provide enough RAM," unless you know the performance characteristics and you really mean it when you say "that should be enough RAM." If you don't have any swap and the kernel starts to run out of memory, it's going to start evicting whatever pages it can back to disk.

(Wait, pages back to disk? I told you I didn't have swap) Yes – the linux kernel can page things back to disk even if you don't have swap, remember all of the binaries you're running have originally come from that disk, and the kernel knows it doesn't strictly need to have them in memory until they are volatile, or you tried to read those pages again.

Having some swap gives the kernel something else to evict, so have a healthy amount of swap and Linux will find the occasion to use it for the least frequently used pages that are not already on disk. This will improve your "nearly out of memory" performance.

The second worst thing that you can do is put your swap on fast SSD or NVMe, and it's not why you think. The kernel is making decisions based on a heuristic which is complicated and well-documented, but inscrutable. If the solid disk is 50x faster than the spinning disk that the swap was originally designed to use, then swapping will cost less overall and the heuristic will lean on it as a strategy to keep the OOM killer away even more often. You may find your cache recycle rates going through the roof because things can be paged out to disk and re-loaded faster than should be possible. I don't fully understand this part, but I suspect the answer is "try to use Swap less, and be aware of when you are using it."

The kernel does really not want to kill off your processes, and it has more opportunities than ever to ensure it keeps too many balls in the air when you have asked it to do so. So, find a way to stay ahead of the kernel and know better. If you have a dock widget that tells when you are going above 50% swap usage, you can close some tabs before it gets to be an unrecoverable situation. It's a mystery to me why modern computers don't come with disk activity lights, as this problem we didn't need dock widgets to solve 20 years ago when literally every computer came equipped with one.

The best advice is to have enough RAM for whatever you're doing, and at 32GB "I think you've had enough." At any rate the one suggestion that I could give is, if you anticipate running out of memory (ever, and it looks like you still do), then you should be sure to have a healthy amount of swap, to me that's probably at least 5 or 6GB but YMMV.

But, 32GB for a desktop workstation really ought to be enough IMHO, so try to find a way that you don't run out? If you're eating all that memory up with VMs, try a lighter weight solution for your ephemeral workloads like footloose, which behaves like a VM in the ways you generally tend to want for your dev workloads, (like for example, it can run systemd like your deploy target most likely does, if you're using VMs to match the deploy target). Footloose doesn't impose the "VM's" whole footprint upfront due to actually being a container, so when you run out of memory it will be because your application workloads used too much, not because your virtual machine manager has grabbed much more than it needed.

All that being said, my daily driver is a Mac and I don't think about this stuff either, until it affects a server.
> I get fed up with 2 hours of battery life

As I'm typing this, I got 14hours and 33minutes of battery left and it's only charged to 83%. In hardcore scenarios out of the grid for a few days (where I go sailing) I got a few spare batteries. (the laptop is the Lenovo X270)

> In this case, I'm measuring my productivity by the time it takes to mess around with the OS to get the desired result, and the fact that the stability baseline just never seems to get there.

The time investment goes down significantly over time. After a decade using linux on as a daily driver, I don't remember the last time I've tweak anything.

> fed up ... and go back to macOS.

Same thing but the other way around. I stay away from my Mac except for:

- making sure my applications look good enough on a Mac and are usable

- making music as I'm not patient enough to relearn everything on a different platform but that's just laziness from my end

>The time investment goes down significantly over time. After a decade using linux on as a daily driver, I don't remember the last time I've tweak anything.

So, it gets stable after the first 4-5 years of tweaking. Doesn't that make the parent's point?

And after those 4-5 years, wont one have to get a new laptop at some point, upgrade to newer OS version, and adjust to whatever changes the FOSS projects like Gnome/KDE/etc did in the previous years all from the beginning?

>- making music as I'm not patient enough to relearn everything on a different platform but that's just laziness from my end

Just laziness? As if Linux has anything remotely as powerful/coherent as Live/Cubase/Logic/etc, Native Instruments, Arturia, and all the other VSTs?

> And after those 4-5 years, wont one have to get a new laptop at some point, upgrade to newer OS version, and adjust to whatever changes the FOSS projects like Gnome/KDE/etc did in the previous years all from the beginning?

But that's part of what I love about linux, my text-based configuration doesn't have to change because I upgrade, unlike on Mac where the name of some `defaults write` key suddenly renames or disappears altogether.

In the rare cases that something in a Linux distribution changes so much it upends your config, you're just a package install away from getting the old behaviour back until you want (if ever) to deal with it.

Reaper and bitwig run on linux. Plenty of reaper users come from other daws. Daw choice is mostly workflow preference than feature differences.

Vsts though... people use Carla that’s based on wine to use windows vsts. Results vary.

Yeah sure, I've heard it all. Let me guess: What you conveniently forgot to mention is how you only use terminal applications with a minimal window manager, which makes a comparison to MacOS or Windows completely pointless since their desktop environments are 40 years advanced and thus have to do a lot more computation.
There's very little net gain to changes in GUI. Most of the fundamental metaphors actually date from the MoaD, December of 1968, fifty-one years ago this year.

Actually, that still has capabilities lacking from "modern" GUIs.

https://www.invidio.us/watch?v=yJDv-zdhzMY

jwz observed that "UI is different" years ago when discussing Safari vs. Firefox interface changes. (Wayback link to avoid his "special greeting" for HN visitors): https://web.archive.org/web/20120511115213/https://www.jwz.o...

I watch "normal" computer users struggling to keep up with even very modest changes to MacOS UIs. Which, for the record, are remarkably consistent with the first iteration, deployed in 2001, eighteen years ago. It's older now than the Classic Mac interface was when OS X was introduced (1984 - 2001: 17 years).

That's not the point.
What is the point of advances if not to provide greater end-user utility, functionality, ease of use, etc?

Again: changes in GUI demonstrably do not deliver that.

And good GUIs don't change.

Because in large part of the institutional cost of breaking shell scripts, TUIs don't change often (and tools violating this principle are quickly and sharply deprecated and/or replaced with those that don't). Which means that as a user (or administrator or programmer), the investment you put into using console tools tends to have an exceedingly long half life.

Mind: I'd given this deliberate and conscious thought in the mid-1990s when I was faced with a few possible directions to take my own computing career and use. I'd already seen numerous platforms, notably proprietary and GUI ones, change substantially, or die entirely. Seemed to me that the skill-preserving route would be with Linux or the BSDs. That's proved a good decision and rationale.

Even a "minimal window manager" -- say, twm or vtwm, provides extensive functionality and does not change. There's a hell of a lot to be said for learning a skill once and not having to either replace it with another, or keep obsoleting previously acquired knowledge and habits.

I don't use twm myself, outside occasional testing. One of the best and most skillful programmers I've ever known did use it, and had a highly tricked out configuration, almost completely keyboard driven, that let him fly around his display and workspaces with an amazing faculty. The fact that the windowmanager itself is flyweight and bedrock stable only added to this.

My own preference is WindowMaker, based on the design principles of NextStep (1988), and largely static since the late 1990s. It has capabilities modern WMs and DEs still lack, is extremely high performance, and extraordinarily stable. Graphically, it's nonobtrusive. I might swap it for a tiling WM, but it's served me well for over two decades.

> After a decade using linux on as a daily driver

I mean, this is hardly an endorsement for people early in their careers who haven't already concluded the Linux is the best path forward.

Actually, it is.

I'm in my fourth decade of technical activity. I'm leveraging skills and tools I learned in my first day using Unix, in the mid-1980s.

Over the same time, I've gained, and obsoleted, skills on CPM, MacOS, VM/CMS, MVS, VMS, DOS, Windows 3x, WinNT, and classic Macintosh.

Yes, there are a few flavours of Unix -- BSD, SysV4, Solaris, HPUX, Irix, AIX, FreeBSD, and numerous Linux flavours. Those, and even OSX/MacOS share far more in common than all the other platforms.

Unix knowlege has proved extraordinarily durable, as have the tools. Though there are new utilities and environments coming out frequently, old standards remain available and still work. I'm not forced onto that treadmill, most especially not for my personal work.

GRRM still uses Wordstar. Works for him.

(That's ... one of the editors I've used as well, though I vastly prefer vim these days -- one of those "first day on Unix" skillsets I'm still earning dividends on.)

I'm not exactly sure the GRRM point hold true. He might write on Wordstar, but the distraction free writing environment hasn't exactly helped him finish books in a decade.
Have you seen the control-group results? ;-)

There's also Stephen Bourne, who had initially programmed in Algol, and has a bunch of Algol-like macros that he uses when programming in C. I'm not finding an original source, though several references turn up.

Muscle memory is a real beast to change. The local optimum is always "stick to what I know".

I've not had obscure graphics or bluetooth problems for like 4 years now. Graphics problems have not been a problem for the last decade.

I've been running linux desktops and laptops for about 20 years, starting with early/pre-RHEL redhat, and moving around to many others. My first laptop was a pentium thing at 75 MHz, and I triple booted Linux, OS2, and Windows/DOS on it. I wound up kicking off the last two, as I used them only infrequently.

Battery life is an issue for me, but its not linux specific. The laptops I have, all have power hungry ram and GPU cards. I get 2 hours on them, or if I play with the brightness and other things, I can stretch it to 4 hours. My old 2010 laptop (still in use, still running linux) is a 16GB ram, 0.5TB SSD affair with an NVidia GTX560m card. My 2018 laptop is a 48GB ram, 1.5 TB SSD (0.5 + 1.0) with an M2 256GB SSD for the included windows 10 home, and a GTX 1060m card. Windows 10 on the newer laptop lasts about 2.5 hours before it shuts down. I now run the pre-installed windows 10 via a kvm with passthrough of the M2 into the instance.

All of these are currently running late model Linux Mint 19.2 with accelerated graphics.

Work laptop is a Mac 16 GB ram, 512GB SSD with an intel/AMD hybrid graphics bit. This will last 5 hours with significant tweaks to aggressive power off, and me not running any builds on it.

I like the mac for its physical fit and finish, weight, etc. But I need to bring the power supply with me, as I can burn through much of the power in a 2 hour meeting.

I like the linux machine for work, and everything else. It just works. The drivers just work. The networking just works. Single/multi displays just work. I have cinammon (display manager) set up to a very comfortable configuration.

I am hopeful that the day job will enable me to trade up to a bigger machine with linux and nvidia graphics at some point ... 32GB is bare minimum for a functional machine for me, 48->64GB is better.

My home office deskside is an older Sandy Bridge machine with 16 cores, 128 GB ram, old GTX750ti card, running the same environment as on my laptop.

Of course, YMMV.

> Graphics problems have not been a problem for the last decade.

Except one happens to have a laptop with an older AMD card or Optimus Intel/NVidia combo.

Older AMD? Any AMD card or igp made in the last 14 years works out of the box with Linux, save their newest GPU arch.
Tell that to my AMD Radeon HD 6330M, released in 2010, 8 years ago.

The open source driver still doesn't provide feature parity with the proprietary one that Ubuntu LTS dropped support for.

https://www.omgubuntu.co.uk/2016/03/ubuntu-drops-amd-catalys...

Namely hardware video decoding and OpenGL version.

Sounds more like AMD dropped support for Linux. It's shitty, but I'm not sure what you can expect from distributions if AMD stops updating their drivers for newer versions of xserver.
Yep, while you can still get the up-to-date driver for Windows, fully DirectX 11 compliant.

So this thing about marvelous open source AMD support, depends pretty much how much luck one has.

I don't have laptops with older AMD. My current laptop has the ability to switch between CPU and discrete GPU, but it doesn't work well even under windows, so I disabled it in BIOS.

AMD drivers have been hit and miss for a while, which is one of two reasons I tend to prefer NVidia cards. NVidia took time to make sure their whole stack works reasonably well.

what brand/model is your 48GB laptop? I'm shopping for something that can take lots of ram.
This is a Sager Notebook NP8156. There are newer models, including better NVidia cards. Up to 64 GB ram. I bought mine with 16GB and added 32GB. Very expandable. Battery life is 2-ish hours, though can be increased by reducing brightness.

Lenovo has a 32 GB max model, and HP has a 64 GB max model.

I've been using Linux full time for 3 years now and I agree. Linux comes with lots of little, edge casey bugs. Like a thousand paper cuts, they add up and hamper productivity.

I can finally say Ubuntu MATE 18.04 for me is pretty solid. There's still two issues I wrestle with, but other than that it's been very dependable for me.

When it comes to OSes these days, I feel like you have to pick the least bad one. A truly rock solid OS just doesn't exist in my experience.

Same. I use Linux (specifically Ubuntu) on my work/study computer and I love it.

But, weird hardware issues popped up now and then which I didn't have to deal with on my MacBook, such as the wifi card that had to be manually installed, the headphone jack sometimes doing weird things, the processors overheating.

I was able to solve those problems by searching online and finding others who had the same issue which lead to instructions to fix the problem, but I just can't imagine my family members who have never used the Terminal in their entire life having the same success.

The fact is that with my old MacBooks (and the computers I've given to my family) the only hardware related issue we've had over the last 10+ years is the battery related issues from the MBP.

I've been using Linux for the last two years, having switched from macOS, and I haven't had a single weird problem. Not one.

I use Arch Linux, and a combination of KDE and i3 so one would expect me to have a ton of rediculous problems. But I haven't had a single problem. It took me a single day to set up my computer how I wanted it (I've used Linux before) and I haven't had to touch a config file since.

Part of this might be that in using a Dell XPS DE, which is designed to work well with Linux, but I think it might just be a YMMV situation. And I do a lot of back end, applications, web and front end development (mostly in my spare time), so I think I've hit a lot of programmer use-cases.

Also, I get 15 hour battery life streaming 4K video on my 4K touch screen, and more doing other stuff.

I also used an Apple Magic Touchpad or whatever over Bluetooth with it, including gestures and it worked really well. Better, actually, as far as Bluetooth, than my Mac. I only stopped because it wasn't good for my hand and wrist health.

Just adding my anecdata. Overall my experience with Linux has been hugely positive.

> or I get fed up with 2 hours of battery life and go back to macOS.

Not sure about the Bluetooth part (i had this kind of issue once in like 10 years) but the battery life, getting 2 hours is not common anymore. Sure, you won't get as long as Windows on the same hardware more of the time, but 5 to 7 hours on a full charge is what you can expect, if not longer.

This and it's come a long way in the last 10yrs but it's more dependent on hardware. Optimus still an issue with nvidia (3hrs) vs 630(5hrs) and have to switch between. However, just bought a pair of (used) x270's to travel with - one has Fedora and the other windows 10. Linux lasts 8-9 hours and the Windows about the same (maybe less).
Maxed out X250 had been reported to last 26h hours online, with plain debian install, no tricks like Macs' "oh, you look outside, I'll go to sleep now"
Anecdotally, my cheapo $500 linux laptop gets a full work day (so 6-8 hours depending on what I'm doing, unless I run docker, then it gets maybe 3 hours tops) while my previous 2017 $2000 macbook pro typically got around 4 hours for the same type of work.

I did spend about 2 hours optimising for battery when I got the laptop, but it was a once-off thing.

I guess this all depends on your dependence on mobile hardware.

Bluetooth? I don't even use it. Battery life? I'm on a desktop.

It's a good idea to research any components for compatibility before buying them.

It's true that Linux won't run with all hardware, but this is even more true for MacOS ;)