3 ms·
(I have worked as an engineer on both Ubuntu and Chrome) > One tab on chrome takes about 100MB memory, why? It probably doesn't. Much of that apparent memory
by keybuk 9y ago
(I have worked as an engineer on both Ubuntu and Chrome)
> One tab on chrome takes about 100MB memory, why?
It probably doesn't.
Much of that apparent memory usage is shared between all tabs, and the browser renderer process, etc. in the form of shared memory.
Quite a bit of it will be the executable code itself, which is "mapped" into memory, given an address, and allocated the full size but doesn't actually consume memory until it needs to be read from disk.
And a large part of that memory is going to be the giant white pixel buffer that you want it to draw into, which is typically mapped to a texture buffer in the GPU memory.
- btschaegg 9y agoAdditionally, the number you come up with (as "MiB of RAM used by an application") might also depend on the OS features the application uses and not directly be obvious by its functionality. Example: I've been doing some experiments around DWM thumbnails in MS Windows. My program doesn't really do much and shouldn't use too much memory (and doesn't, at least initially). I create a thumbnail for each visible window on the screen (say 5 of them), and -ding-, my process uses >400 MiB.
- smt88 9y agoBut Windows itself does this when you hover over a taskbar entry, right? Explorer is never that heavy for me. Or is the process totally different?
- blattimwind 9y agoA compositor doesn't create a separate image for stuff like this. Every window is rendered into a texture and things like thumbnails are simply a small texture-mapped quad; it's done for each frame by the GPU.
- Dylan16807 9y agoMy "private bytes" numbers very from 50 to 300MB per chrome process, so that's not counting shared memory or untouched memory. An HD pixel buffer is only 6MB.
- reificator 9y ago> An HD pixel buffer is only 6MB. Don't forget that the browser splits out different layers and composites them together, so it'll be a little bigger than that.
- noobermin 9y agoOkay, may be OP's estimation of that being a per tab usage was not quite right, but why does ~30 tabs result in 3GB+ of usage?
- JCSato 9y agoMay be happening for other people, but I've never had this happen. 60+ tabs and it never breaks 2GB.
- sebcat 9y agoIf I Shift-Esc in Chrome with one tab open, it shows that this tab ("Add Comment") consumes 0 bytes of shared memory and 163 828 kB of private memory. Current window size is 1280x800. Assuming the render buffer is ARGB32 and assuming one render buffer (which is probably an incorrect assumption) that should be ~40MB. The GPU memory is listed as a separate entry in that view, but I don't know if that is also included in the "private memory" listing. Going turn off javascript and restart and see what it says then. EDIT: 164 856 kB w/o JS. So no change (relatively).
- londons_explore 9y agoZero bytes of shared memory? So you have no other processes running which have libc loaded in?
- sebcat 9y ago$ ldd chrome | wc -l 124 Shift-Esc is Chrome's own task manager. I don't know how they count.