Remix.run Logo
▲ kamranjon a day ago

Also mine is sipping on 53mb of memory with multiple tabs open - pretty awesome. I hope it avoids eventually turning into the type of experience I have with chrome and firefox where the browser ends up consuming 20gb of memory and has to be restarted periodically so I don't run out of system memory.

▲simscitizen a day ago | parent | next [-]

Browsers are runtimes and webpages are apps. They just happen to be apps that are dynamically fetched over the network and are packaged as HTML/CSS/JS instead of as PE/ELF/Mach-O binaries.

Runtimes can have bugs or inefficiencies that cause them to use more memory than strictly necessary, but by and large most memory problems are the product of the apps (or webpages) themselves.

▲panta 12 hours ago | parent | next [-]

The view of web pages as apps and browsers as runtime environments/OSes is reasonable but in my opinion it even reinforces the idea that it should be the browser duty to contain bad behavior from web apps/pages. Browsers are well positioned to do so, as they know exactly which resources are used by each tab , and how those grow over time. Also browsers already treat web content as untrusted (sandboxing, isolation), so it would be a natural next step to extend that approach to resource usage. It would match how Operating Systems work, where it's the OS acting as an "arbiter", not the userland application.

▲paulluuk 11 hours ago | parent | next [-]

I would love it if all the major browsers would agree on this. "Every tab is only allowed up to 100mb of memory, if a page needs more than that, optimize it." - Though a setting from the user to allow it for, say, online videogames or streaming sites or something, would be a good idea.

▲Wowfunhappy 4 hours ago | parent | next [-]

I remember when I was a Safari user, any instance of Slack I had open would get reloaded after 5 – 10 minutes with the message "this web page was reloaded because it was using two much memory", interrupting whatever I was doing.

My computer had many gigabytes of memory, so I always found this very annoying. Like, yes, Slack is a giant memory hog and that really sucks, but I can't exactly do anything about that.

Maybe Google would have the clout to actually enforce a memory limit like this, but I'm not sure whether anyone else does at this point. Apparently even Apple wasn't big enough.

▲copirate 11 hours ago | parent | prev [-]

Using more RAM could be a permission request.

▲YmiYugy 10 hours ago | parent | next [-]

1. It would break a very large number of existing sites. 2. The vast majority of users aren’t able to make an informed decision. 3. Browsers already have heuristics to inform users about misbehaving tabs and suspend them. 4. It hurts performance. More pressure on gc, more cache thrashing

▲brigandish 8 hours ago | parent [-]

It’s all about the UI. The browser vendor could make the informed guess and say “we think this web page is using too many resources”. Certainly Google could ascertain this during its spidering. Browsers already have several similar interventions e.g. no https, script taking too long etc.

Regardless, if it improved the experience then it becomes like Firefox was in the beginning, and Chrome in the beginning, a better performing competitor about to eat market share.

▲throwaway2037 9 hours ago | parent | prev [-]

Why do you think none of the major browsers have already done this?

▲lo9i 8 hours ago | parent | next [-]

Agree, most people just want to visit a site and use it. Don't want to be bother with permission requests. You read the permission request the first 2, 3 times. Then just allow forever and you are back to the same scenario

▲dotancohen 9 hours ago | parent | prev [-]

Because users would have no idea what to do.

I think the Corvette once had a special key for driving with enhanced performance, or maybe the key had to be turned to another position, I don't remember which. That caused so many service calls that later 'Vettes dropped it. And in the case of the Corvette, we're already talking about an enthusiast community that ostensibly actually takes an interest. Not so with people who call their browser "the internet".

▲lproven 7 hours ago | parent [-]

> Because users would have no idea what to do.

Agreed. Nice idea but it's too much.

▲lukan 11 hours ago | parent | prev [-]

It is non trivial to determine if ressouces a site is using is reasonable or not. A web game may use lots of ressources and will crash if the OS suddenly decides to take some memory away.

▲drnick1 9 hours ago | parent | prev | next [-]

> Browsers are runtimes and webpages are apps.

The internet was a better place when webpages were not seen as "apps."

▲dotancohen 8 hours ago | parent [-]

Though I agree, I am grateful that services such as my banking and national insurance are available via the browser and do not require me to install their own apps on each device. I have no banking apps on my phone nor desktop, Firefox is my window to all those services. I can put my trust in Firefox, I would not put my trust in each outsourced app each for each service I use.

▲rileymat2 14 hours ago | parent | prev | next [-]

I am not following the logic.

Say I write a static html page that loads a series of images down the page where one image will fit on your screen at any time. If the browser loads them all into memory at once without releasing the memory or maintains the a fully rendered virtual page out of sight, is that bloat the app or runtime fault?

▲8n4vidtmkvmk 14 hours ago | parent | next [-]

Both.

Runtime can certainly be optimized, but the app can also virtualize or force unloading if it needs to.

▲rileymat2 2 hours ago | parent [-]

I am just talking about a page that is something like a descriptive document for the browser to deal with, probably less than 500 bytes.

     <html>
     <body>
     <img...>
     <br>
     <img..>
      ...
      </body>
     </html>
▲mkgiga 13 hours ago | parent | prev | next [-]

It's a difficult question because there are so many factors in dom/css that change the answer to 'is there a chance that the image should be rendered the next frame?' that it becomes really hard to implement a strategy for what content to offload to disk and when

If the runtime fails to load the offloaded data back in time there will be visible rendering artifacts so you really have to make sure your strategy is robust

▲imp0cat 12 hours ago | parent | prev [-]

If the static page is badly written and does not instruct the browser to use lazy loading (using the loading="lazy" attribute on the img tag) and the browser loads them all at the same time, is that a problem with the page or the browser?

▲KronisLV 8 hours ago | parent [-]

The whole ecosystem.

Lazy loading for images was only introduced around 2019, not every website out there will have been updated since (and retroactively become “badly written”).

It is also not on by default, because the platform itself is too conservative and the implementation doesn’t allow zero breakage changes of defaults like that.

The tooling culture around HTML also isn’t such that you’d be prevented from deploying a site if you can use it but don’t, at least you’re not railroaded towards that.

Lazy should have been the implicit default and we should have gotten loading=“eager” instead. Same with having sane calendar controls, dropdown and collapsible controls, video controls so good we wouldn’t need vendor equivalents, light boxes for images and so on.

▲zeroq 15 hours ago | parent | prev | next [-]

> Browsers are runtimes and webpages are apps. Surprised to see that.

I've been championing this mind set for nearly 20 years now. The message was more clear in the Flash era, but once you realize that your webpage is an (/a desktop) application that only happen to live in a browser - it makes a lot of reasoning and designing a lot easier.

▲ZenoArrow 12 hours ago | parent [-]

> I've been championing this mind set for nearly 20 years now.

I don't want to tell you you've wasted your time but it's fairly obvious that webpages are sometimes documents, sometimes apps and sometimes a hybrid between the two. For example, YouTube is clearly an app, but a webpage written predominantly in HTML and CSS is much more of a document than an app.

▲perching_aix 10 hours ago | parent | next [-]

how do you define a document?

i'm not trying to be glib, i get what you mean, i just wonder if you have an actual criteria. I've been struggling with this from time to time over the years.

▲ZenoArrow 8 hours ago | parent | next [-]

> how do you define a document?

I would say a contained set of words, sometimes accompanied by static visual data (e.g. images), which aimed to convey ideas or information.

For example, a post on a recipe blog website can be seen as a document, even if there are sometimes some interactive elements (like being able to change ingredient amounts based on desired portion sizes), and even if there's usually a CMS behind the scenes helping the website author update their recipes, as the written recipe is at the core of what is being transmitted.

On websites the wide array of interactive elements do blur the lines between documents and apps, but the web was designed as a document sharing medium first and had app functionality bolted onto it afterwards. It's perfectly possible to have a website with zero JavaScript.

I don't know if that fully answers your question, but hopefully it's of some use.

▲gabrielhidasy 7 hours ago | parent | prev | next [-]

Anything I can print and still get most of the utility is a document. Even expand it a little to Harry Potter style print+video.

IMHO the distinction is on interactivity, if I'm expected to click around to change state (not just get to other page) then its an app, if not, it's a document.

▲dotancohen 8 hours ago | parent | prev [-]

Static (informative) content, for a first pass heuristic.

▲zeroq 11 hours ago | parent | prev [-]

You sir, you would be fairly dumbfounded to find that most people think that webpages are for showing trivial things founded on the backend side of them applications. Like when you want to change a filter on your amazon page and it suddenly give you a different page altogether, you know?

▲grim_io 11 hours ago | parent | next [-]

Most pages probably don't need to be anything else.

I hope we can move past the movement of everything should be a web app.

▲zeroq 3 hours ago | parent [-]

You missed the point. It's not about everything has to be an app. It's about thinking about webapps with the same mindset as ordinary (dektop) apps.

▲ZenoArrow 10 hours ago | parent | prev [-]

I didn't say Amazon was just a webpage, did I. Perhaps you're dumbfounded because all you use on the web are web apps.

▲Jasonsf737 11 hours ago | parent | prev [-]

Should browsers enforce per-tab memory budgets?

▲taneq 11 hours ago | parent [-]

Maybe not by default but it'd be good to have the option, yeah.

▲dotancohen 8 hours ago | parent [-]

If you use a 32-bit browser, each tab is limited to 2 GiB. Firefox still publishes 32 bit builds for Linux.

▲nicoburns a day ago | parent | prev | next [-]

According to the Ladybird Discord, you're likely only measuring the root process there. Each tab is a separate process.

▲Joe_Cool 2 hours ago | parent | next [-]

Yeah I get about 500MB for an Instagram tab (don't use it but just tried if that opens and it does) and 200MB for the Hackernews tab. Still pretty impressive.

And the base UI needs 250MB of which 120MB are shared mem.

▲ a day ago | parent | prev | next [-]
[deleted]
▲kamranjon a day ago | parent | prev [-]

at least in osx i havent noticed other processes - have you?

▲nicoburns a day ago | parent | next [-]

I can't find them in the Activity Monitor, but if you open Ladybird's own task manager from the inspect menu they are there.

▲kamranjon 21 hours ago | parent [-]

Ah ok... I must have been mistaken then - in Lady Bird with 5 tabs open (one of them a youtube video playing) - Lady Bird's task manager says it's using 2.2gb of memory.

▲gabeio 15 hours ago | parent | prev | next [-]

you have to put activity monitory into `All Processes, Hierarchically` to have the children nested, you can then see all of them. (assuming you are using activity monitor on osx)

▲yborg 2 hours ago | parent [-]

TIL ... Why is this not a button/dropdown...

▲simonw 21 hours ago | parent | prev [-]

Here's a script that shows the process tree for Ladybird: https://gist.github.com/simonw/b9162f1741b96fea72b11c300b749...

▲eviks 14 hours ago | parent | prev | next [-]

There is a simple fix for that in existing browsers - enable unloading of some of those tabs. Does Ladybird have such an option?

▲WanderPanda 16 hours ago | parent | prev | next [-]

IIRC the Ladybird creator said that the Chrome memory footprint is largely a tradeoff of cache-sizes vs. speed. I still hope they will let users control that tradeoff manually in Ladybird

▲sheepscreek 10 hours ago | parent | prev [-]

> Also mine is sipping on 53mb of memory with multiple tabs open

Finally a browser for the Ozempic era. Time to get healthy (message to the incumbents).