6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat May 04, 2024 12:27 pm

All times are UTC




Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Wed Oct 18, 2017 12:34 am 
Offline
User avatar

Joined: Tue Oct 25, 2016 8:56 pm
Posts: 360
I think the basic idea with multi-process is that if one process/tab crashes, it won't take the whole browser with it. It'd be pretty awful to have some stupid javascript/flash heavy advert in one tab crash the browser and take that long forum post you were about to submit with it!

_________________
Want to design a PCB for your project? I strongly recommend KiCad. Its free, its multiplatform, and its easy to learn!
Also, I maintain KiCad libraries of Retro Computing and Arduino components you might find useful.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 12:36 am 
Offline

Joined: Sat Jun 04, 2016 10:22 pm
Posts: 483
Location: Australia
True. I see the reasoning there, but I would have thought it was possible to have a thread crash without totalling the entire process.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 12:47 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8430
Location: Southern California
The rare times Firefox has crashed on me, the whole thing went, not just one tab.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 4:22 am 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
RalfK wrote:
Two poblems: Windows is not a real multitasking environment, and Firefox became horrible especially everything with Javascript.

Yea, that's nonsense. It was sorta true 20 years ago, but modern Windows at the kernel level is quite remarkable. It'll multi-task your socks off.

cbmeeks wrote:
I know *exactly* why this happens. Well, not exactly but I know who's causing it. It's the networking stack. I literally have 20+ years of experience with this. Let me explain...

The only thing that locks up my Mac is waiting for an external, sleeping drive to wake up. That seems to freeze the UI (and likely everything else). I've never had the network stack freeze the system. Individual requests, sure, but not the system.

BigEd wrote:
Two other things: virtual memory means you may be paging to hard drive, and large memory spaces mean your application might be garbage collecting for a time.

Virtual memory is lousy on active processes. With modern, large server processes running systems that are garbage collected, swap is death. One trip through the garbage collector sweeping a swapped heap is thrash city, as it tries to page everything in. We have some servers with no swap at all, I'd rather processes fail "quickly" when they run out of resources than swap and just flail. Linux will kill the largest process it can find when it runs out of memory. That's honestly a better outcome than swapping it out first. Tuned correctly, the servers don't run out of memory. Running out of memory is a "bug". I can deal better with a dead program than a thrashing, seizing and unresponsive operating system.

commodorejohn wrote:
These are big ones as far as those 15-second delays go. What drives me crazy is how the entire system can grind to a halt if one application needs to swap. I've seen this on Windows, Mac, and *nix - run a browser with a bunch of tabs chewing up a couple GB, and the whole computer, from the UI layer down to other applications, starts to judder or just stops until the hard-disk light goes off. So much for multitasking!

Yea, if things are badly swapped out, everything is basically in suspended animation. I've had processes on my Mac (large source code check out among other things) just decide to fill up virtual memory and swap everything else out. Come back and, even after killing the offending process, you now have these barely conscious processes that need to be swapped in. And the display is a lie, you can have an active window with the process barely there. As soon as you activate it, it pages in, so it's a painful process of touching everything on your desktop to wake it up. Many times, it's simply just faster to restart, but that's not necessarily always doable.

Also, the modern Mac OS, has practically given up on swap. With SSD backed systems, what the Mac will do (with cooperating applications), when its memory pressured, is simply kill the application, but leave the window on the screen. When you activate the window, the Mac silently reloads the application and, ideally, you're just where you left off. This tech is lifted from iOS which does this all the time.

iOS is as much magic trick as it is anything else. But the plan is sound. On iOS it is cheaper (notably in terms of energy) to leave applications open than it is close out unused ones. The OS will simply kill things off when they're exhausted. iOS doesn't "swap" per se, it's easier to delegate that problem to the app developers who need to take in to account the idea of a "fast restart". It's not just that the OS can do this, recall the user can simply click the home button, at any time, and go back to the main menu. This is a perfect example of where the app should shut down, and save the current work, waiting to be recovered later. It may be killed right there, it may not.

Also, of course, on the Mac, the OS will leverage the virtual memory system to compress memory on the fly. This is a pre-stage state of an idle app, any memory pages just kind of quiet can be compressed transparently by the OS. So, Mac OS is actively moving away from swap.

DerTrueForce wrote:
I have trouble understanding why internet browsers eat such horrendous amounts of memory. And I think the multi-process model is partly a way to obfuscate how much memory/CPU time things are using. I'm pretty sure there's no real need to go multi-process. Multi-thread will probably cut it plenty fine.

Internet browsers eat horrendous amounts of memory because they cache a boat load of data. Because modern web pages are bloated sows of markup and javascript. Then you have the physical copy of the page, (i.e. the text loaded from the server) along with the internal memory model (the DOM), which is very rich. Then you have the javascript code itself, it's original text, it's internal, compiled byte code representation, and also the JITed machine code representation. 3 times the storage, 3 times the fun.

The multiprocess model is partly to keep bad pages from nuking the entire browser. A thread model can't save a process necessarily from a process level fault. But it's more designed to better sand box the pages with an eye toward security and cross tab exploits as much as anything.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 6:21 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
Indeed, we should these days be as worried about compromise of our systems as about the inconvenience of a crash. One sure way to lose performance is to have someone else in control of what runs on your machine.

As we're already in an OT thread, and talking about bloat, Things That Turbo Pascal is Smaller Than might be of interest:
Quote:
The entire Turbo Pascal 3.02 executable--the compiler and IDE--was 39,731 bytes.


Compressing unused pages is a nice trick. As is failing fast. My RAM-challenged ChromeBook used to die thrashing every week or so, and now it works much better, by killing processes instead. See crash-only software.

My MacBook is pretty reliable, but I did fork-bomb myself a couple of weeks ago with an ill-advised
Code:
make -j


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 6:27 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8430
Location: Southern California
BigEd wrote:
As we're already in an OT thread,

not particularly, as there are at least a couple of private threads going on regarding making a 65-based PC. Yeah, I know, we've had several of these in forum topics over the last 15 years, and nothing ever became of them; but advancing programmable logic technology, the increasing expertise on this forum, and other factors, may eventually make it happen. Your topic, Ed, is precisely one of the motivators.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 6:53 am 
Offline

Joined: Sat Jun 04, 2016 10:22 pm
Posts: 483
Location: Australia
GARTHWILSON wrote:
... there are at least a couple of private threads going on regarding making a 65-based PC.

I would like to see that happen. It would be interesting, if nothing else.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 6:56 am 
Offline

Joined: Sun Apr 10, 2011 8:29 am
Posts: 597
Location: Norway/Japan
Alarm Siren wrote:
I think the basic idea with multi-process is that if one process/tab crashes, it won't take the whole browser with it. It'd be pretty awful to have some stupid javascript/flash heavy advert in one tab crash the browser and take that long forum post you were about to submit with it!
That's exactly it. Plus that you gain the ability to kill a 'tab' that's using 100% CPU (which happens too often - unfortunately browsers are not good at telling you *which* one).

DerTrueForce wrote:
True. I see the reasoning there, but I would have thought it was possible to have a thread crash without totalling the entire process.
A thread is part of the same process space. If you get an illegal memory access the process will be (or must be) terminated, it doesn't help that it's a separate thread.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 9:18 am 
Offline

Joined: Sat Aug 19, 2017 1:42 pm
Posts: 35
Location: near Karlsruhe, West-Germany
whartung wrote:
RalfK wrote:
Two poblems: Windows is not a real multitasking environment, and Firefox became horrible especially everything with Javascript.

Yea, that's nonsense. It was sorta true 20 years ago, but modern Windows at the kernel level is quite remarkable. It'll multi-task your socks off.

30 years ago I learned something about "my" first multitasking system: OS-9/68k. Even a modern Windows is not able to compete with that old system.

Let's look at the modern Firefox and Windows: my FF 45(esr) ran well, but my actual FF 52(esr) sometimes blocks my Windows for 10 or 15sec. If Windows would have implemented real multitasking other tasks would continue. But they are now(!) blocked. Means: this is no real multitasking.

Regards, Ralf


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 9:37 am 
Offline
User avatar

Joined: Tue Oct 25, 2016 8:56 pm
Posts: 360
GARTHWILSON wrote:
The rare times Firefox has crashed on me, the whole thing went, not just one tab.


That's because 1. until very recently FF was not multiprocess. It is now, as of FF55 I believe, but only kinda - it uses a maximum of four processes and distributes the tabs amongst them, instead of a process per tab. 2. Its possible for that the crash was at the browser level rather than the tab level anyway. Child processes crash with the parent if the parent dies.

_________________
Want to design a PCB for your project? I strongly recommend KiCad. Its free, its multiplatform, and its easy to learn!
Also, I maintain KiCad libraries of Retro Computing and Arduino components you might find useful.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 9:51 am 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 672
[edit: whoops, didn't see there was a 2nd page already! :oops: and there's no post deletion on this board]

I'm not sure which is the biggest culprit of memory usage, but fonts at many different sizes, bitmap caches for scrolling and compositing, full intermediate layout details being cached for shorter delta changes instead of complete recalculation, all would seem to be able to grow really big. And that's of course not counting the massive javascript libraries & frameworks that people love piling on.

Another standard line around threads vs processes is that processes work as sandboxes, so if some page is breached it won't have access to others' memory space. But that's kind of moot, because if your running executable is compromised, they have full access to your user permissions in your system anyway.

_________________
WFDis Interactive 6502 Disassembler
AcheronVM: A Reconfigurable 16-bit Virtual CPU for the 6502 Microprocessor


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 11:37 am 
Offline

Joined: Mon Aug 05, 2013 10:43 pm
Posts: 258
Location: Southampton, UK
RalfK wrote:
whartung wrote:
RalfK wrote:
Two poblems: Windows is not a real multitasking environment, and Firefox became horrible especially everything with Javascript.

Yea, that's nonsense. It was sorta true 20 years ago, but modern Windows at the kernel level is quite remarkable. It'll multi-task your socks off.

30 years ago I learned something about "my" first multitasking system: OS-9/68k. Even a modern Windows is not able to compete with that old system.


Just look at BeOS, and to a much lesser extent AmigaOS. Good multitasking OSes are possible, it's just that none of them survived.

I suspect a big reason for Window's failings are down to the vast amounts of third party code hanging around in the (already massive) core kernel. No matter how good your memory management, task scheduling, IO scheduling, network stacks etc, if you have crummy code in the kernel then it is jeopardised.

Quote:
Let's look at the modern Firefox and Windows: my FF 45(esr) ran well, but my actual FF 52(esr) sometimes blocks my Windows for 10 or 15sec. If Windows would have implemented real multitasking other tasks would continue. But they are now(!) blocked. Means: this is no real multitasking.


Browsers and the web now do the job previously taken by Games: they push hardware to be better and better, while providing exactly the same experience as last year's version. It takes Ghz of CPU and GB of RAM to view pictures of your sisters cat on facebook. The web and everything associated with it is basically terrible. Luckily I only view half a dozen websites. :) At least Flash is dead!

_________________
8 bit fun and games: https://www.aslak.net/


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 18, 2017 12:19 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1207
Location: Soddy-Daisy, TN USA
Aslak3 wrote:
I suspect a big reason for Window's failings are down to the vast amounts of third party code hanging around in the (already massive) core kernel. No matter how good your memory management, task scheduling, IO scheduling, network stacks etc, if you have crummy code in the kernel then it is jeopardised.


This is absolutely true. Also, let's not forget that Windows has the burden of being backwards compatible going all the way back to 80's DOS. Granted, not all apps work but a vast majority of them do. Even on my Windows 10 machine. This backwards compatibility has all kinds of performance costs as well as being ugly many times. The fact that it works at all is amazing.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 19, 2017 7:02 am 
Offline

Joined: Sun Apr 10, 2011 8:29 am
Posts: 597
Location: Norway/Japan
Also remember that even the best multi-tasking OS (not that I think Windows is really one) will have *some* internal kernel lock or resource which can in some circumstances slow down the system, or even block it.


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 19, 2017 4:26 pm 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 269
Location: Placerville, CA
Yeah, sure, but is it really too much to ask that one process swapping to/from disk not bring the entire system to its knees?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: drogon and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: