Posted by hrncode 12 hours ago
LinkedIn uses 2.4 GB RAM across two tabs
Most people use it for messaging and keeping contacts. The feed and the posturing that occurs on it is a weird sideshow.
I'm seeing 72MB in the network tab (7MB transferred--that's due to compression). An incredible 10MB is HTML (800K transferred), a more incredible 11MB of CSS (500K transferred), 25MB of JS (3MB transferred), 16MB XHR (1MB), 17MB images (1.7MB transferred).
A lot of the HTML is inline JS in `window.__como_rehydration__` -- letting a server-side rendered be dynamic as if it were fully client-side rendered.
The size of the CSS also presents in bloated HTML. Why not have 18 classes on your button? `<button class="_5732bd68 _4cbf0195 _00dac29f _737a8a8c b241f848 _9572431e _56fd9a8a ff367c5b f7a6e63a aa661bbd b1e8a5cc d6e0deb3 _0582e059 f7e4b8f0 f9d5d3fb e037a5e8 _340d09d4 fbc7d17b" ...`
Checking again it went down to 78meg. Still 78MEG!!! Thats over 1200 Apple IIs, Commodore 64s. I use to run Windows 3.1 for Workgroups, and in it run Microsoft Word, Excel, etc, on machines with 4meg. Now, a simple page of text is taking 78
I get why to some degree. It's highres 32bit display, multi-layered. The screen itself requires 36meg (40bit RGBA, 40bit because it's an HDR display). Each window itself is a texture. If the window is the same size as the screen then that's 36meg. Font Glpyhs are high-res antialias.
Compare that to my Windows 3.1 machine. OSes didn't use textures then and didn't anti-alias. GPUs didn't exist and the screen was 1024x768 or something small like that. Software rendering from fonts that were 1 bit per pixel.
I'm not saying that excuses browsers nor LinkedIn. Rather, if you go add up the basic pieces you'll find that part of the reason these things take lots of memory is because these things take lots of memory.
But other ideas: - all pages of FE site loaded at once instead as as needed - FE indexed search engine - bug rendering too many invisible HTML elements (eg 1M select boxes)
other avenues - local slack channels.
linkedIn - good for initial connection with strangers you don't know and might find valuable
linkedIn - good for keeping tabs on companies or new startups
If you do what I do, live in my general area and know the right people (which I do), LinkedIn will get you an interview or three lined up in a day or two. None of these people are on Indeed, HackerNews or even Slack.
Most of LinkedIn is just garbage though, especially if you somehow connected with social-media people or marketing people. Marketing people on LinkedIn are weird, they can't form coherent sentences and they can't even sell themselves.
You could strip down LinkedIn down to your resume, availability status and your email address and it would be fine.
Why not?
Can we talk about how it's possible that any application short of video editing can require so much RAM?
In fact, I've done video editing on computers with 1GiB of RAM back in 2004 and it worked fine, (for the 1024x768 resolution which was en vogue at the time)..
Is linkedin doing something complex? Is there a reason that it requires more resources than my entire computer from 20 years ago, or my entire operating system, text editor and compiler today?
Firefox has gotten very good at safely handling allocation failures, so instead of crashing it keeps your memory snugly at 100% full and renders your system entirely unusable until the kernel figures out (2-20 minutes later) that it really cannot allocate a single kilobyte anymore and it decides to run the OOM killer
but also
it's not cheap? Why should everyone upgrade to 32GB RAM to multitask when all the text, images, and data structures in open programs take only a few megabytes each? How can you not get hung up about the senseless exploding memory usage
It's better not to use 2.4G RAM in the first place. Imagine LinkedIn isn't so hostile to users and instead actually cares about user experience.
MADV_FREE (since Linux 4.5)
The application no longer requires the pages in the range
specified by addr and size. The kernel can thus free these
pages, but the freeing could be delayed until memory
pressure occurs.
and MADV_DONTNEED
Do not expect access in the near future. (For the time
being, the application is finished with the given range, so
the kernel can free resources associated with it.)
After a successful MADV_DONTNEED operation, the semantics
of memory access in the specified region are changed:
subsequent accesses of pages in the range will succeed, but
will result in either repopulating the memory contents from
the up-to-date contents of the underlying mapped file (for
shared file mappings, shared anonymous mappings, and shmem-
based techniques such as System V shared memory segments)
or zero-fill-on-demand pages for anonymous private
mappings.
Does Chrome use it, though?The other day Safari was using over 50GB with only a few tabs open.
Maybe we should also acknowledge that some companies particularly have no compassion for users (and their desires or needs) and see them as hurdles in their way to take money from users.
The websites are jam packed with trackers and ads. I am utterly concerned about Chrome’s memory usage because it’s passively allowing this all to occur.
How about you let me blacklist sites that are using too much memory automatically, all that means is that those website owners FUCKING HATE THE REST OF US.
Any solution to this epic fucking problem would be wonderful.
March is "MARCHintosh" month for retro Macintosh computing, for fun I wrote a networked chat client. It has some creature comfort features like loading in chat history from the server, mentions, user info, background notifications, multiple session. It runs in 128 kilobytes of RAM.
Automatic garbage collection memory management was a mistake. The memory leaks we had when people forgot to free memory was nothing compares to the memory leaks we have now when people don't even consider what memory is.