Follow

Hey Chromium, Dear Firefox. You two realize you're not actually a virtual machine, right?

Could you please stop fighting over who can use the most memory? It's not a contest.

@fribbledom Browser becoming operating systems running JavaScript (eh, and Wasm!) is one of the worst jokes of IT history, I think. 😉

@letterus @fribbledom There was that old joke about Emacs being an operating system that happened to include a text editor... Web browsers are basically that now.

@kazriko @fribbledom Especially since you can‘t read information anymore because everything is covered by cookie banners.

@fribbledom with all of the sandboxing and whatnot they kind of are. Doesn't necessarily excuse them using that much RAM though.

@fribbledom Actually, I think they think they are virtual machines.

@fribbledom But they are! All those JS code ain't running on nothing :02smile:

@koakuma @fribbledom "JS is the new assembly" an unironic statement I heard from a guy on a Scala workshop :not_like_okuu:

@fribbledom Of course it gobbles up memory for breakfast, it's a JVM

JavaScript Virtual Machine

@fribbledom

So in the early 90s, SUN had a research project that produced the Self programming language. Self is a Smalltalk dialect/descendant that is prototype-based instead of class-based (i.e. OOP but without classes; objects hold methods directly.)

Self was the testbed for modern JIT research; lots of clever compile-multiple-versions-of-methods stuff. It was fast but consumed a *huge* amount of memory for the time.

(ctd)

@nelson

I still periodically check selflanguage.org and take a stab at finding something I can play with.

@nelson

So this prompted me to take another look and I was able to get the 2017 builds running on Linux and macOS.

@fribbledom

So, clever but not usable because it basically brought a high-end workstation to its knees if you were also trying to do other things.

Anyway, JavaScript has exactly the same issues as Self and all of this research has made its way into modern browsers' implementations.

And so most of that RAM is used to hold cleverly-JIT-compiled versions of code that will track your browsing habits and show you ads.

@suetanvil @fribbledom It'd be interesting to see a study on how much energy the ad-tech "industry" actually uses compared to the "whole" of computing, recognizing there would be a lot of guess work and estimations.

@edd @fribbledom

There's Les Orchard's 2015 analysis of The Verge:

blog.lmorchard.com/2015/07/22/

tl; dr: a single (~1000 word, IIRC) article required 75k of HTML and 12 *MEGABYTES* of third-party content, 7MB of which was JavaScript.

@fribbledom It’s not a virtual machine, it’s many different and extremely complicated virtual machines in one, unfortunately.

@fribbledom so what features does a VM have that a web browser doesn't?

@GNUxeava
so is a web browser. it just has more jobs to do than a VM. @fribbledom

@guenther @fribbledom actual research-based thread management, memory management, and other resource management; simple host-level control and limitation of host resource access and usage; ability to have multiple sandboxed environments; ability to define an environment programmatically; ability to import and export environments....

man, browsers would be pretty cool if they actually had real VM features, come to think of it

@fribbledom

I can’t even run Firefox and Chrome together, if I’m using my default profiles on each (with all the extensions). My computer will just come to a halt.

@fribbledom
Well, they are virtual machine managers for all the ECMAscript VMs being run by the web pages...

@fribbledom - that shows how bloated the modern web is. 35 GB that's crazy 😯

@fribbledom Or rather, it is a contest, but they don’t realize it’s scored like golf, not bowling.

@fribbledom for goodness sake, you know better than to post nonsense like this.
If you have RAM, the browser will use it. If you're running out of memory, the browser will free it up. That's how garbage collected memory systems and caches and many other technologies *work*.
If for some reason you want the browser to use less memory, run it on a PC with less memory available. I promise you it still works just fine.

@danielcassidy

Well, yes, I certainly do kinda know what's going on in the background. That doesn't mean this isn't problematic. Along with the kernel, now I have two systems fighting over that resource, both optimistically caching away until it's too late. If what the browsers do worked fine, I wouldn't see them getting OOM-killed by the kernel all that often.

@fribbledom OK I concede something is definitely badly broken if they're getting oom-killed by the kernel.

@fribbledom The more RAM you have, the more RAM your OS will use

@fribbledom isn’t unused ram wasted ram? At least that’s how macOS handles ram (as far as I know)

@wex

I'm fine with the kernel using all my RAM for caching, but if individual processes start doing it alongside the kernel, it becomes really messy and uncontrollable, very quickly.

@fribbledom that’s a good point! I’m not too advanced in this topic, so thanks for clarifying 😄

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!