Hacker Newsnew | past | comments | ask | show | jobs | submit | rwmj's commentslogin

It's 2026 and I still can't configure the OOM killer to kill firefox before anything else.

If it helps, I run ff in systemd-run with memory limits set -- that's usually enough to avoid the problem in the first place (ff does freeze when loading google spreadsheets or whatever heavy UI, so I also have a script to adjust /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/app.slice/ff-*.scope/memory.max and memory.high at runtime... I should publish my $bindir someday)

    systemd-run --user --scope --unit=ff-$$.scope \
     -p MemoryMax=4G -p MemoryHigh=3G \
     -p MemorySwapMax=0 \
     firejail firefox "$@"

I looked into this, and actually, it seems like maybe you can? https://man7.org/linux/man-pages/man5/proc_pid_oom_score_adj...

So, in actuality, I think your assertion just taught us all something, because despite knowing that the OOM killer and that the Magic SysRq key[1] exists, I didn't know you could configure this as an input!

[1]: https://en.wikipedia.org/wiki/Magic_SysRq_key


I'm aware of it, but it's awkward to use in practice. You have to track down all the FF processes, each time you run it, and adjust all their scores.

You could launch it as a systemd user target with OOMScoreAdjust=500 in the service section; weird and unconventional but wrapped in .desktop file it doesn't appear to be unwieldy.

Ah. Yes, that is awkward. Well, nonetheless, you taught me a new feature. Thanks!

Maybe firefox could self-adjust, as a policy?

It looks like it does, which depending on your goal is either helpful or part of the problem. By default processes should inherit their parent's oom_score_adj. If I exit out of firefox completely, then start it up (with no saved tabs), this is the behavior I see:

  $ firefox-esr& PID=$!; choom -p $PID -n 42
  [1] 105360
  pid 105360's OOM score adjust value changed from 0 to 42

  $ for p in $(ps --ppid $PID -opid --no-headers $PID); do printf "%3d" $(</proc/$p/oom_score_adj); ps -opid,comm --no-headers $p; done
    0 105360 firefox-esr
    0 105425 Socket Process
  167 105451 Privileged Cont
    0 105456 RDD Process
  100 105495 WebExtensions
    0 105524 Utility Process
  233 105534 Web Content
  233 105542 Web Content
  233 105549 Web Content
See how each firefox process has a different oom_score_adj with Web Content being more likely to be killed than other processes (233), and none of them have the value that the process was started with (42). This is Firefox 140.11 ESR running on Debian 13.

Nice!

Yes this would be nice. Or maybe the OOM system would have two other files, /sys/oom/kill_first and /sys/oom/kill_never which would solve the problem more directly for the majority of cases.

I should really send a patch rather than complaining ...


sounds like a job for a program

It would be nice to have a signal as a warning to process to reduce it's memory footprint or else OOM will kill it.

You still need some way to make the kernel to send those signals to the processes of your choosing. If the kernel decides to send SIGLOWMEM to xlock instead of firefox, the xlock will get killed because it really doesn't have any memory it can give up.

It’s possible via cgroups, kinda.

cgroups v1 has a pretty nice API but it requires root. V2 does not require root but it’s a lot coarser and not as simple or reliable: https://unix.stackexchange.com/questions/753929/receive-a-me...



You can use `earlyoom --prefer firefox --avoid xlock`.

It's not a panacea, but in my case setting browser.tabs.unloadOnLowMemory in about:config helped a bunch.

This. It's always browser running amok. I configured win+k shortcut key to: killall -9 chrome

I always wanted it to target java processes, as they were always the culprit. These days it's python, VSCode, and antigravity.

Maybe not in kernel, but running the earlyoom daemon will let you do exactly that in userspace.

Or to kill anything at all in this lifetime.



We had a whole course at university (early 1990s) about stability in numerical calculations and simulations. Which was basically about rounding errors, plus some higher level mathematical transformations you could apply to stop errors from accumulating. I remember essentially nothing about it except that the lecturer insisted everyone use FORTRAN 77 (including uppercase and punch-card formatting) for the exercises.

I was definitely wondering this. As I understand it they make money on order flow and don't charge for transactions (is that right?). But allowing LLMs to trade dilutes the true information in the order flow.

On the other hand maybe it's just chasing trends, like their previous forays into blockchains. It pays because it keeps their name in the news.


Robinhood (and retail in general) order flow is valuable precisely because there's already no information in it. It's assumed to be more or less random.

Institutional order flow can move the market, or be an indicator that the market is going to move in that direction. So executing against it a worse bet than executing against retail flow.


So much UK govt bureaucracy could be removed. Like tax returns - they have the data already, just send me a bill, and let me query it if I disagree (like it works in other European countries). Or Making Tax Digital, which incredibly is worse than the previous system. Or VAT registration/returns which my partner has to do, which overlap with MTD and acts like a kind of second tax system.

I’ve never submitted a tax return in the UK as a simple PAYE employee.

In another European country where I work (Finland) it’s as you describe but it’s still more than doing absolutely nothing that I did in the UK.


I mean, 90% of employees on the UK(I imagine it's probably 99%) don't ever have to file any taxes - it's all done automatically through PAYE. Only in certain specific circumstances you need to file a self assessment. So yes, I sympathise with the administrative burden for UK businesses, but for employees the system is basically better than almost anywhere else in the world.

Why are people down-voting this?

It's generally correct: If you're self-employed / sole trader and operating outside IR-35, there's no way the HMRC can know how much you were paid as they don't have the info, so they can't know how much tax you owe.

In other situations for payrole / salary (like PAYE for example) they do have the info, as companies have to submit it, so generally people in those situations don't have to submit tax returns (unless they have significant capital gains).

I do think it's a bit annoying you have to declare tax on interest since 2016 if it's over £1000 - previously banks would take it out automatically, and this is still done in other countries (NZ for example).


Don’t let facts get in the way of a good narrative it seems.

You are going to love Digital VAT, closely followed by Real-Time VAT.

This is the researcher's page, but I couldn't find an authoritative source: https://www.law.upenn.edu/faculty/pheaton

Of course it's also possible ChatGPT really did commit the crime!


Question! Is there a counterparty risk with ETFs versus owning the equivalent fund that owns the same underlying stocks? (Assuming there is an ETF and fund that are approximately equivalent.) I trade about once a year, so there's no real benefit to me with ETFs, and I've always preferred funds.

ETFs are supposed to hold the underlying asset, just like mutual funds. In the worst case, you are due your share of the underlying asset.

ETNs (which are sometimes lumped with ETFs but are actually distinct products) have counterparty risk since they aren't required to hold the underlying asset. They are unsecured debt securities issued by a bank.


There are precious metal ETFs that are. Distinct from the "physical" gold funds in that they use derivatives to match the price action of the precious metal instead of buying and storing it

Yes, during the silver boom; I saw an article about how silver ETFs were oversubscribed 80 to the actual silver they owned.

yes, there is counterparty risk with both etfs and mutual funds. in general, stick to the well regarded issuers or fund managers. vanguard is the best imo, they do a lot to protect their shareholders.

But the same argument applies to landlords too. Why are they willingly losing money?

I’m a landlord. I’m losing money because the Seattle market went to shit and nobody will buy this place.

I bought for $850k in 2017. Selling now asking $899k and no-one’s buying. Think of my ARR with inflation and opportunity cost here. I sold Facebook shares to get this. I have made zero return from rents overall. I’d likely have earned $1M if I hadn’t sold those shares.


That's pretty contingent. If you had Snapchat shares instead you'd be ahead.

Even selling up and putting the money into the S&P500 would've done a lot better than that[0], so I think it's a reasonable claim.

[0] https://investment-estimator.com/s&p-500-calculator says $850k in 2017 would be $2.8M by 2026.


Can I ask why you're selling?

Do you happen to be a young person looking to move for better prospects (economic migrant)?


A landlord is unlikely to have the same cost basis as someone buying on a new mortgage. I know many landlords that own their rentals outright. The ability to make a profit renting for less than you'd pay in interest charges alone changes the financial calculation.

That said, landlords don't always have a choice to not lose money. These are investments, there is inherent risk.


A lot of small mom-and-pop landlords are certainly losing money. Especially when they buy properties as their own residence but later converted to a rental. The majority of the Bay Area housing market has basically zero properties that would make a landlord profitable; you only need to compare the market value of a house against the market rent.

And this is really no different from the majority of stock pickers or day traders. They just lose money.


Everyone has a landlord inside them apparently!

This depends on what country you live in, but in the UK renting is (even after recent changes) quite precarious. The landlord can kick you out with a few months notice. They can require regular inspections. They can send workers around to "fix stuff" without you really agreeing to it. Even if you never renovate your bathroom, the security and privacy of owning your own place without landlords bothering you is worth every penny.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: