Discord seems to think so. Is this the solution?
Discord needs a combined total of 3.7GB of RAM over 6 processes to display text and images
>>107484814That's the Unix philosophy as shown in the Unix-Haters Handbook. The right solution is to fix the program so it doesn't leak memory.
I love how bad modern software is
The weirdest part about the problems all these electrons apps have is that Chromium itself doesn't have them. You can leave discord running in Chromium for weeks and it will never go above 300 megabytes of ram. Which is still a lot but you know. And that malware that crashes discord won't even crash the chromium tab let alone the browser. How do they make it worse than it started.
This is what I have to do on my server for the script that checks to see if the VPNs are connected and to connect them if they're not. For some reason, it will just hang, and then it will just be stuck using 100% CPU, and drive my temp up by like 20°C. I honestly don't use the VPNs that often they're kinda on standby, so sometimes it took a while before I noticed. I couldn't figure out what caused this so I made a cron job that reset it every day. Wasn't enough so I had to change it to every hour. Things are better now. I do wish I could fix the problem at the root.
>>107484814>zoomers rediscover garbage collection
>>107484821don't forget live streaming your screen to the NSA and training AI's to imitate your behavior so they can trap you inside a digital prison where a cursor and keyboard input has been training to act just as you would for all eternity and they keep messing with you by draining your bank account and tormenting you in various ways.
>>107484814Actually yesI worked on a server before and the way to handle incoming requests was (not ky design or idea, just how it all worked) >fork>malloc as much as you needed while handling request, never call free>simply kill process when doneWhat discord should do is to do it behind the scenes so that the client appears to not restart when actually it does. Just let the main window etc be handled by a small and tight process and then do all the work in something that you restart when needed. I mean why not.
Dynamic memory allocation is the work of the devil
>>107484814It works for payment terminals. Its a lot easier to make a program work well if you know how long its going to run for.
I despise Electron so fucking much
>>107484814peak technological prowess
>>107484814>modern appsRestarting has been the number one solution for all resource management since resource management was inventedWhy do you think so many services still in this day and age have regular maintenance? Most of the maintenance is just checking that everything came back up after the restart
>>107485738That's CGI, right?
>>107484814wow, zoomers discover shit we did with java on the backend 15 years ago
>>107486086this. it's why the first step in troubleshooting is to turn it off an on again. it's a fundamental part of our entire reality for that matter. even the human brain, which is an incredibly complex organic computer, turns our consciousness off and on again every single day of our lives.
>>107484814STOP USING DISCORDUSINGDISCORD
>>107486612sounds fair. why don't you turn your life off then back on?
>>107484878Because Chromium is typically built with a Chromium hardening level of 2 (Arch Linux artistically builds with 3 even though it breaks some emoji and causes the entire thing to crash when you close the last incognito tab). Electron is built with a hardening level of 0. Why anyone allows any of these things to make network requests is beyond me.
>>107486612It's literally why we're mortal. It's easier to just start fresh by spewing out a child and dying than to evolve a body that can live forever (except for a few extremely simple creatures)
Today I will remind them.https://doc.rust-lang.org/std/boxed/struct.Box.html#method.leak
>>107486086It's fine for the end user to do that to fix a problem. It's even fine for the dev to push out a quick fix that auto restarts while they work on the full solution. Planning and testing that as a feature instead of tracking down and fixing the leak is retardation.
>>107484814why not just check what's taking so much memory and think hard on if it's necessary and maybe remove that part?
>>107485861dynamic memory allocation is fine you just shouldnt need this much memory for a voip program
>>107484814It's a bandaid fix for incompetent coding.
>>107488669There's 0 reason why voip should have unbounded ability to allocate more.
>>107488669Most programs genuinely don't need it. I don't need my shell to be able to allocate unbounded amounts of memory to store variables or something, a few megabytes should be enough.Discord shouldn't need unbounded allocations to load some messages with scrollback.
>>107489021unc, I didn't pay for discord nitro just so some RAMlet could decide how obnoxious my 4K 60fps avatar looks
Just get more RAM.What, are you poor?
jeetcode saaaaaarplease understand
>>107484826>bro all you need to do is just invent a nuclear fusion reactor
>>107488954>>107489021its also a chat program where the chat servers include media so its somewhat justifiable why it can go bigger than something more simple and less-bloateddynamic memory is based and should always be used in any but the most fixed-memory-requiring programs. you should not be taking memory you're not sure you're gonna use.
>>107489021>I don't need my shell to be able to allocate unbounded amounts of memory to store variables or something, a few megabytes should be enough.Discord shouldn't need unbounded allocations to load some messages with scrollback.Those should be easy to handle without memory leaks because they're basically strings. Memory leaks come from having circular data structures and complicated tree structures with a lot of sharing, which are hard to handle without garbage collection.>>107489350If you use C/C++ it is like inventing a nuclear fusion reactor, but if you use a normal language, it's easy.
>>107484814Not the worst band-aid while they figure out the real problem
>>107486180YesAnd no, we weren't running CGI, but it was inspired by it
>>107484814Why the FUCK is discord using 24GB of ram
>>107490289what would be worse than killing the process?
>>107490956Doing nothing
>>107484814>application restarts 50 times in the background without me interacting with it at all
>use discord in browser>no need to restartWeird.