5 ms·
Back in the good old days, you would actually run out of memory. It kept you on your toes unlike today when allocs rarely if never fail. Instead, everything jus
by yason 15y ago
Back in the good old days, you would actually run out of memory. It kept you on your toes unlike today when allocs rarely if never fail. Instead, everything just collectively gets paged out to disk, then sluggish and sloshed, and eventually inoperable. And at that point you really can't pinpoint it down to some stupid web page because everything is equally paged out by the time.
THe browser could turn memory hogging tabs to red. It could impose an absolute or relative limit to each tab's memory usage. Or what used to be nice in the old days, having each tab expose a function that causes it to minimize its memory usage, i.e. ditch any runtime data that can be recomputed later. But since webpages are programs these days, this interface ought to be negotiated between the browser and creators of web pages. Not going to happen.
Since web pages are sort of programs, I like the Chrome way of putting them into separate processes. Then let the operating system manage them: it's much better suited for that than a browser. Using setrlimit(2) to limit the amount of memory could be useful. Automatic killing and restarting of a web page upon hitting these limits would give an incentive for the developers to keep their pages small; or not keep them small but design them to just deal with these mandatory resets.
- 1amzave 15y ago> Back in the good old days, you would actually run out of memory. It kept you on your toes unlike today when allocs rarely if never fail. Instead, everything just collectively gets paged out to disk, then sluggish and sloshed, and eventually inoperable. And at that point you really can't pinpoint it down to some stupid web page because everything is equally paged out by the time. There's always swapoff(8) if you want that behavior back...might want to tweak your /proc/$PID/oom_adj (assuming Linux) to make sure the OOM-killer axes the "right" process, though.