by keybuk · 8y ago · 0 comments
> 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.
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).
$ ldd chrome | wc -l
124
Shift-Esc is Chrome's own task manager. I don't know how they count.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.
Or is the process totally different?
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.