Righteous Wrath Online Community

General => Tech Chat => Topic started by: Darren Dirt on November 01, 2010, 04:37:26 PM

Title: Chrome as a single process?
Post by: Darren Dirt on November 01, 2010, 04:37:26 PM
If you are gonna do something with multiple tabs open in Chrome, and don't care if "one tab crash brings it all down", then consider this...

Quote
You may wish to right-click your Chrome shortcut, go to the "Target:" field, and append (add) the "--single-process" to the end.

For example, if I did this, mine would look like exactly this (quotation marks included):

"C:\Users\Bapa\AppData\Local\Google\Chrome\Application\chrome.exe" --single-process

This should help performance with Chrome on those older machines. If you hadn't guessed it already, this makes the entirety of Chrome all ride together in the same wagon. So much more cuddly; but if the wagon falls over, everyone dies.

Personally, I'm finding that opening Chrome, just to a SINGLE tab (i.e. Google.ca) will make like 6 or 7 processes launch (all "Chrome.exe") ... and this is on pages with no Flash, btw. wtf...


Edit: it's my extensions, apparently... but weird that even the simplest of them takes up 16MB, at launch of Chrome). Lotsa learnin' here: http://www.google.com/support/forum/p/Chrome/thread?tid=5d15844c7c5ac9db&hl=en and here: http://blog.chromium.org/2008/09/multi-process-architecture.html



cliffs: never mind, multiple processes using same amount of RAM as FF would (in a single process) so Panic Mode Off, the "single process" switch not really gonna help, and not a good idea:
http://blog.marcchung.com/2008/09/05/chromes-process-model-explained.html <-- a very good, brief, clear read! (also see http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/chrome_switches.cc?view=markup )

Title: Re: Chrome as a single process?
Post by: Tom on November 01, 2010, 06:05:42 PM
Yeah, Chrome's memory use is a big blocker for me. Firefox is bad enough, but Chrome takes it to an entirely new level. I can hardly wait till Arora or rekonq start to really stabilize, that and KDE/OpenDesktop launches its cloud service so we can get some magic browser syncing.
Title: Re: Chrome as a single process?
Post by: Mr. Analog on November 01, 2010, 06:57:12 PM
I still don't see the performance hit you guys seem to have, for some sites having a browser that can smoke through JavaScript is a must.
Title: Re: Chrome as a single process?
Post by: Tom on November 01, 2010, 07:32:11 PM
Quote from: Mr. Analog on November 01, 2010, 06:57:12 PM
I still don't see the performance hit you guys seem to have, for some sites having a browser that can smoke through JavaScript is a must.
I don't find it slow. It just uses up a LOT more memory than any other browser with my current browsing habits.
Title: Re: Chrome as a single process?
Post by: Darren Dirt on November 01, 2010, 08:09:01 PM
Quote from: Tom on November 01, 2010, 07:32:11 PM
Quote from: Mr. Analog on November 01, 2010, 06:57:12 PM
I still don't see the performance hit you guys seem to have, for some sites having a browser that can smoke through JavaScript is a must.
I don't find it slow. It just uses up a LOT more memory than any other browser with my current browsing habits.

Other browsers' RAM usage is HIDDEN... with Chrome it has a separate process for each piece: the browser itself, the tab, each addon or extension, and the rendering of each, and the scripting of each. As long as you don't open too many too quick, I think Chrome handles it most optimally among modern browsers.

I just gotta stop having so many FLASH pages open at once (YT + KITH still got like 30 open, been 3 days, lol) otherwise Chrome has been fine for me, speed-wise, even with tons of tabs. But see Mr. Analog's bolded text above, HELL YEAH.
Title: Re: Chrome as a single process?
Post by: Tom on November 01, 2010, 08:17:27 PM
Quote from: Darren Dirt on November 01, 2010, 08:09:01 PM
Quote from: Tom on November 01, 2010, 07:32:11 PM
Quote from: Mr. Analog on November 01, 2010, 06:57:12 PM
I still don't see the performance hit you guys seem to have, for some sites having a browser that can smoke through JavaScript is a must.
I don't find it slow. It just uses up a LOT more memory than any other browser with my current browsing habits.

Other browsers' RAM usage is HIDDEN... with Chrome it has a separate process for each piece: the browser itself, the tab, each addon or extension, and the rendering of each, and the scripting of each. As long as you don't open too many too quick, I think Chrome handles it most optimally among modern browsers.

I just gotta stop having so many FLASH pages open at once (YT + KITH still got like 30 open, been 3 days, lol) otherwise Chrome has been fine for me, speed-wise, even with tons of tabs. But see Mr. Analog's bolded text above, HELL YEAH.
You can't really call it /hidden/. Chrome uses more ram per tab, period. I find myself running out of ram and swapping with chrome long before I do with firefox.

One thing I had to do to cut down on ram use with firefox was install Flashblock. So I don't have a bunch of flash ads running in the background. Again, its not a speed issue for me. Just pure memory use issues.
Title: Re: Chrome as a single process?
Post by: Darren Dirt on November 02, 2010, 11:37:28 AM
http://www.youtube.com/html5

found via Molly http://www.youtube.com/watch?v=GsLmdC98Avg


I tested it, it works (in Chrome, anyway) http://www.youtube.com/watch?v=-JND9BB7ctI
Title: Re: Chrome as a single process?
Post by: Thorin on November 02, 2010, 11:51:11 AM
Quote from: Tom on November 01, 2010, 08:17:27 PM
You can't really call it /hidden/. Chrome uses more ram per tab, period. I find myself running out of ram and swapping with chrome long before I do with firefox.

One thing I had to do to cut down on ram use with firefox was install Flashblock. So I don't have a bunch of flash ads running in the background. Again, its not a speed issue for me. Just pure memory use issues.

Given that you're a strong proponent of Linux, I assume you're running Chrome and Firefox on Linux?  What tool are you using / how are you confirming that your RAM is full and being swapped out? (and by RAM, I mean the actual physical RAM, not some abstraction within the operating system)

If we were talking about Windows I would suggest that looking at Task Manager tells you nothing about memory usage.  It does not accurately show physical memory (RAM) used per process, nor does it show what part of each process's memory space is already pre-written to the swap file, nor does it show what part of the memory space is actually the re-mapped system memory space.  I would also suggest that memory management concepts are a great deal more complicated than most people make them sound - for instance, Windows does pre-fetching and pre-swapping to try and stop process interruption due to file I/O; both these functions follow complicated algorithms to try and determine when to take action.
Title: Re: Chrome as a single process?
Post by: Thorin on November 02, 2010, 11:52:58 AM
Chrome has several settings.  Here's my customized shortcut:

"C:\Documents and Settings\tcenek\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --enable-accelerated-compositing --enable-accelerated-2d-canvas --start-maximized
Title: Re: Chrome as a single process?
Post by: Mr. Analog on November 02, 2010, 09:01:00 PM
I guess the question is: how much RAM usage is "acceptable"?
Title: Re: Chrome as a single process?
Post by: Tom on November 03, 2010, 09:21:12 AM
Quote from: Mr. Analog on November 02, 2010, 09:01:00 PM
I guess the question is: how much RAM usage is "acceptable"?
Not one or more GBs. Not for a few tabs. Unless I'm being extra crazy and have a couple hundred tabs open with crap like flash loaded.
Title: Re: Chrome as a single process?
Post by: Thorin on November 03, 2010, 05:20:56 PM
See, I'm not seeing that kind of usage, Tom.  That's why I'm wondering how you're measuring it.
Title: Re: Chrome as a single process?
Post by: Tom on November 04, 2010, 01:11:39 AM
Quote from: Thorin on November 03, 2010, 05:20:56 PM
See, I'm not seeing that kind of usage, Tom.  That's why I'm wondering how you're measuring it.
Maybe I'm just a heavier user (*cough*). I tend to get up towards 20+ tabs open. If I have a bunch of doc pages for Qt or KDE open, 40+ easy. But I still remember back using konqueror or earlier versions of firefox, when I had 1G ram and stuff ran just fine. These days I need 512M-1G just for firefox.

Here's firefox's current useage:


Private      +  Shared  = Total
--------------------------------------
434.2 MiB +   3.9 MiB = 438.2 MiB       firefox-bin


I have 13 tabs open in two windows. I find that a bit hard to swallow. 40-50MB/tab :(

And this is /after/ tweaking firefox's settings so it only caches one or two pre-rendered pages, has a small in ram cache, and some other memory saving things.
Title: Re: Chrome as a single process?
Post by: Mr. Analog on November 04, 2010, 11:54:20 AM
Is it causing any performance issues with other apps?

I have two instances of Chrome open and it's using something like 54.7 MB of RAM but it doesn't impact my system so I don't really care.

That said, Firefox is so mind-bendingly slow that I just don't use it for anything anymore.
Title: Re: Chrome as a single process?
Post by: Tom on November 05, 2010, 12:04:57 AM
Quote from: Mr. Analog on November 04, 2010, 11:54:20 AM
Is it causing any performance issues with other apps?

I have two instances of Chrome open and it's using something like 54.7 MB of RAM but it doesn't impact my system so I don't really care.

That said, Firefox is so mind-bendingly slow that I just don't use it for anything anymore.
Over using memory tends to make me run out of memory, so yes. Even with 4G ram.. And the intel gfx drivers on linux don't like it when you run out of memory. Things start to glitch, and occasionally X might crash (yes, a bug in the driver.. I've been reporting the crashes to the intel linux developers, and they actually get fixed so woo). And then of course theres swapping. Not good for performance, specially on my laptop, got its hdd is slow.
Title: Re: Chrome as a single process?
Post by: Mr. Analog on November 05, 2010, 12:59:13 PM
Quote from: Tom on November 05, 2010, 12:04:57 AM
Quote from: Mr. Analog on November 04, 2010, 11:54:20 AM
Is it causing any performance issues with other apps?

I have two instances of Chrome open and it's using something like 54.7 MB of RAM but it doesn't impact my system so I don't really care.

That said, Firefox is so mind-bendingly slow that I just don't use it for anything anymore.
Over using memory tends to make me run out of memory, so yes. Even with 4G ram.. And the intel gfx drivers on linux don't like it when you run out of memory. Things start to glitch, and occasionally X might crash (yes, a bug in the driver.. I've been reporting the crashes to the intel linux developers, and they actually get fixed so woo). And then of course theres swapping. Not good for performance, specially on my laptop, got its hdd is slow.

Ahhh, gotcha, ok.
Title: Re: Chrome as a single process?
Post by: Tom on November 06, 2010, 03:11:22 AM
Quote from: Mr. Analog on November 05, 2010, 12:59:13 PM
Quote from: Tom on November 05, 2010, 12:04:57 AM
Quote from: Mr. Analog on November 04, 2010, 11:54:20 AM
Is it causing any performance issues with other apps?

I have two instances of Chrome open and it's using something like 54.7 MB of RAM but it doesn't impact my system so I don't really care.

That said, Firefox is so mind-bendingly slow that I just don't use it for anything anymore.
Over using memory tends to make me run out of memory, so yes. Even with 4G ram.. And the intel gfx drivers on linux don't like it when you run out of memory. Things start to glitch, and occasionally X might crash (yes, a bug in the driver.. I've been reporting the crashes to the intel linux developers, and they actually get fixed so woo). And then of course theres swapping. Not good for performance, specially on my laptop, got its hdd is slow.

Ahhh, gotcha, ok.
To be honest, I start getting unhappy when I see my memory use meter reach half (not counting cache's and whatnot). Even a modern OS, with my typical use patterns shouldn't use more than 2G regularly. Generally if it gets over half, that means something is horribly wrong somewhere, and it will eventually fill all the way up. Or at least thats my current excuse ;D (of course this doesn't apply when I've got a VM or two open ;D)
Title: Re: Chrome as a single process?
Post by: Darren Dirt on November 12, 2010, 09:49:21 AM
Quote from: Darren Dirt on November 02, 2010, 11:37:28 AM
http://www.youtube.com/html5

^ been using it for quite some time now, works great (and when it won't work, then Flash kicks in) ... but WARNING: funny "joke" by the Google devs, if you right click the HTML5 video during playback and choose "Save As..."
Title: Re: Chrome as a single process?
Post by: Mr. Analog on November 12, 2010, 09:59:29 AM
Quote from: Tom on November 06, 2010, 03:11:22 AMTo be honest, I start getting unhappy when I see my memory use meter reach half (not counting cache's and whatnot). Even a modern OS, with my typical use patterns shouldn't use more than 2G regularly. Generally if it gets over half, that means something is horribly wrong somewhere, and it will eventually fill all the way up. Or at least thats my current excuse ;D (of course this doesn't apply when I've got a VM or two open ;D)
Hmm, well now that's a pipe of a different colour. Being aware of resource usage changes how a person thinks significantly.

Sort of like how time is relative to the observer, go a day without looking at a clock and compare that to a different day where you check your watch every 15 minutes, it's pretty startling.

Things on a computer sometimes seem slower when you think of resources are being "taken" (instead of being used).

I've actually seen this behavior in clients when testing a "new" version of the application. They automatically think it's going to be worse and when they run their test they get a higher number of negative results, we blind-tested this once by telling them we had installed a newer version of the app and had them test...
Title: Re: Chrome as a single process?
Post by: Lazybones on November 12, 2010, 10:10:30 AM
Root problem.. Flash sucks even harder under linux so you should block it or unload it.

Newest builds of Chome let you load FLASH on click instead of default http://www.webmonkey.com/2010/11/chrome-now-offers-click-to-play-option-for-flash-other-plugins/
Title: Re: Chrome as a single process?
Post by: Mr. Analog on November 12, 2010, 10:16:03 AM
Quote from: Lazybones on November 12, 2010, 10:10:30 AM
Root problem.. Flash sucks even harder under linux so you should block it or unload it.

Newest builds of Chome let you load FLASH on click instead of default http://www.webmonkey.com/2010/11/chrome-now-offers-click-to-play-option-for-flash-other-plugins/

That's a pretty handy feature. I know a lot of guys who roll around the 'net with noflash/noscript enabled. I find the net navigable enough with just AdBlock though.
Title: Re: Chrome as a single process?
Post by: Darren Dirt on November 13, 2010, 02:30:15 AM
Quote from: Lazybones on November 12, 2010, 10:10:30 AM
Root problem.. Flash sucks even harder under linux so you should block it or unload it.

Newest builds of Chome let you load FLASH on click instead of default http://www.webmonkey.com/2010/11/chrome-now-offers-click-to-play-option-for-flash-other-plugins/
^ that's how I usually have Flash, via one of the Flash Block extensions ( https://chrome.google.com/extensions/detail/gofhjkjmkpinhpoiabjplobcaignabnl ) ... but if it's now built-in to be "disabled until you click it" then I'm very happy, can go back to CTRL+clicking 20 Youtube tabs at a time ;)
Title: Re: Chrome as a single process?
Post by: Tom on November 13, 2010, 05:02:15 AM
I've actually been testing out Chromium lately. Just because I have a love-hate relationship with iceweasel. It does seem to use a lot of memory still, but the tab process separation is actually a god send in this case, if you close a tab thats using a lot of memory, the kernel can actually free that memory, since the process has exited. Not so with a single process, most libc's will NOT give back memory to the OS once its been (s)brk'ed. So even after closing a bunch of tabs in iceweasel, most of its memory use won't reduce, however with chromium it does \o/ and that makes me happy. What doesn't make me happy is I tend to have to clean up my tabs quite often, since it uses more memory per tab...

Oh, and it seems both Chromium and Iceweasel have a nice memory leak with a silly little bandwidth monitoring page I set up. It could very well be my fault, but as far as I can tell, the only "leak" I intentionally have in the js is a Graph object I recreate every update, rather than re use it. But then browsers tend to have memory leaks in their innerHTML handling it seems. Do a lot of repeated dynamic generation, and they all have a history of leaking a lot...
Title: Re: Chrome as a single process?
Post by: Mr. Analog on November 13, 2010, 07:22:43 AM
Quote from: Tom on November 13, 2010, 05:02:15 AMOh, and it seems both Chromium and Iceweasel have a nice memory leak with a silly little bandwidth monitoring page I set up. It could very well be my fault, but as far as I can tell, the only "leak" I intentionally have in the js is a Graph object I recreate every update, rather than re use it. But then browsers tend to have memory leaks in their innerHTML handling it seems. Do a lot of repeated dynamic generation, and they all have a history of leaking a lot...

Well, it's partially the browsers fault for not cleaning up orphaned elements but I know for a fact that innerHTML can run away on you on any browser. You're dynamically adding and removing elements and handlers from the DOM without going through the DOM itself so the browser has to do all the heavy lifting and frequently loses track of event handlers and orphans DOM elements. Orphaned elements and event handlers will use memory but are completely inaccessible to the DOM making it impossible to delete them. I found a hack for this in IE6 but I'm not going to share it because it's vile and absolutely the last resort (sort of like eating people to stay alive). It would be much better to rewrite your code so it directly adds/removes elements through the DOM Level 2 API, way cleaner.

I would say this is a fairly common problem among developers, it's easy to forget what's going on with memory in a scripting language (I know because I forget all the damn time).

Woo! New forum Achievement: Cannibalism and DOM Level 2 in one paragraph! :rofl:
Title: Re: Chrome as a single process?
Post by: Darren Dirt on November 13, 2010, 10:45:16 AM
Quote from: Mr. Analog on November 13, 2010, 07:22:43 AM
Woo! New forum Achievement: Cannibalism and DOM Level 2 in one paragraph! :rofl:

dammit my stupid trivia-filled brain just HAD to go re-find this...
http://www.youtube.com/watch?v=B1A-Ymf1VYY <-- NSFW/kidunfriendly warning obv.
Title: Re: Chrome as a single process?
Post by: Mr. Analog on November 13, 2010, 04:06:04 PM
Quote from: Darren Dirt on November 13, 2010, 10:45:16 AM
Quote from: Mr. Analog on November 13, 2010, 07:22:43 AM
Woo! New forum Achievement: Cannibalism and DOM Level 2 in one paragraph! :rofl:

dammit my stupid trivia-filled brain just HAD to go re-find this...
http://www.youtube.com/watch?v=B1A-Ymf1VYY <-- NSFW/kidunfriendly warning obv.

Achievement: Laughed ass off at linked forum video!
Title: Re: Chrome as a single process?
Post by: Tom on November 13, 2010, 11:42:32 PM
Well I'm actually using prototype's update and insert methods. Whether or not they use innerHTML themselves, I don't know.
Title: Re: Chrome as a single process?
Post by: Mr. Analog on November 14, 2010, 09:06:56 PM
Quote from: Tom on November 13, 2010, 11:42:32 PM
Well I'm actually using prototype's update and insert methods. Whether or not they use innerHTML themselves, I don't know.
Well, generally JavaScript frameworks abstract these operations but give you configuration options to use on method or another where available. Hopefully Prototype gives you some control over that otherwise youch!.
Title: Re: Chrome as a single process?
Post by: Tom on November 15, 2010, 05:25:28 PM
I was just being lazy. I really don't like to use the document.createElement stuff for every single node. Its soo tedious.

Especially once I get to making a fancier ui for the new backend I'm writing using libpcap. The new web interface will be somewhat fancy.
Title: Re: Chrome as a single process?
Post by: Mr. Analog on November 15, 2010, 07:30:08 PM
Quote from: Tom on November 15, 2010, 05:25:28 PM
I was just being lazy. I really don't like to use the document.createElement stuff for every single node. Its soo tedious.

Especially once I get to making a fancier ui for the new backend I'm writing using libpcap. The new web interface will be somewhat fancy.

That's why I like stuff like Dojo, I don't have the time any more to muck around with designing GUI, I just want something that's skinnable and has a decent API

Good on ya!