this post was submitted on 09 Dec 2025
759 points (98.2% liked)

Technology

77096 readers
4168 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
 
  • Windows Latest discovered Discord and other Chromium and Electron-based applications with high RAM usage
  • RAM usage spikes from 1GB to 4GB on Discord both in and out of voice chat
you are viewing a single comment's thread
view the rest of the comments
[–] _cryptagion@anarchist.nexus 131 points 3 days ago (2 children)

I really wish Electron wasn't as popular as it is. It's such a fucking memory hog. I mean, sure, I've got RAM to spare, but I shouldn't need that much for a single app.

[–] cmnybo@discuss.tchncs.de 59 points 3 days ago (4 children)

Yes, it runs a separate browser instance for each electron program. Many of the programs that use it could just be a PWA instead.

[–] lastweakness@lemmy.world 49 points 3 days ago (1 children)

This is what bothers me so much... Browsers should be improving their PWA implementation (looking at you, Firefox) and electron apps should be PWAs more often. Another decent middle ground Is Tauri. SilverBullet and Yaak are both so much lighter and better than anything else on my system.

[–] Pechente@feddit.org 39 points 3 days ago* (last edited 3 days ago)

Yeah but companies want full control and no ad blockers. That’s why they’re pushing shoddy Electron apps over their web experiences and PWAs.

[–] SaraTonin@lemmy.world 4 points 2 days ago

Or, even better, let’s start developing for separate platforms again, and optimise software for the platform that’s going to be running it. Rather than just developing everything for Chrome.

[–] tal@lemmy.today 9 points 3 days ago* (last edited 3 days ago) (1 children)

I wonder how much exact duplication each process has?

https://www.kernel.org/doc/html/latest/admin-guide/mm/ksm.html

Kernel Samepage Merging

KSM is a memory-saving de-duplication feature, enabled by CONFIG_KSM=y, added to the Linux kernel in 2.6.32. See mm/ksm.c for its implementation, and http://lwn.net/Articles/306704/ and https://lwn.net/Articles/330589/

KSM was originally developed for use with KVM (where it was known as Kernel Shared Memory), to fit more virtual machines into physical memory, by sharing the data common between them. But it can be useful to any application which generates many instances of the same data.

The KSM daemon ksmd periodically scans those areas of user memory which have been registered with it, looking for pages of identical content which can be replaced by a single write-protected page (which is automatically copied if a process later wants to update its content). The amount of pages that KSM daemon scans in a single pass and the time between the passes are configured using sysfs interface

KSM only operates on those areas of address space which an application has advised to be likely candidates for merging, by using the madvise(2) system call:

int madvise(addr, length, MADV_MERGEABLE)

One imagines that one could maybe make a library interposer to induce use of that.

I guess the key is it has to be the same version of electron in the back end. If they change too much of it then how much memory can be shared?

[–] plz1@lemmy.world 6 points 3 days ago

I tried the PWA route with Discord. It wouldn't stay logged in, and acted generally janky. That said, I do PWA with any app that's Electron, at least to try and avoid the RAM bloat.

[–] modular950@lemmy.zip 9 points 3 days ago (1 children)

maybe a toggle to choose between "take some extra RAM, I'm feeling generous" and "fuck you, I'm computing shit over here" could be used to let the app know your current mood / needs ...

[–] TheBlackLounge@lemmy.zip 11 points 3 days ago* (last edited 3 days ago)

Memory hogging browsers usually do release memory when pressured. You can take it further by getting extensions that unload unused tabs.

The problem is electron apps that load the whole browser core over and over.