5 ms·
"Idle" memory is used by the operating system as cache. On my computer, 800 MiB of my RAM is in use by programs, but 1.7 GiB of my 2 GiB RAM is used in total, b
by kmm 15y ago
"Idle" memory is used by the operating system as cache. On my computer, 800 MiB of my RAM is in use by programs, but 1.7 GiB of my 2 GiB RAM is used in total, by programs, buffers and cache.
The problem is that an extension like "1-Up for Google+" doesn't need 20 MiB of RAM just to play a sound and display a green mushroom, for a total of about 150 KiB of assets and maybe a few KiB of code.
- jiggy2011 15y agoI've never used "1-Up for Google+" but are you sure it's really only 150KiB worth of assets, if you are measuring file sizes you are looking at compressed data which is useless to your computer. You'd be surprised how big uncompressed data can get, compare a .BMP with a .PNG of the same image for example.
- kmm 15y agoI had uncompressed data in mind, but it was only a rough guess. I'll do a more in depth calculation. 2 seconds of uncompressed sound, at 44.1 kHz, in stereo and 8 bits per sample is 170 KiB. 17 images of on average 24 by 24 pixels at 32 bits per pixel is 68 KiB. Three other, bigger images give another 40 KiB of uncompressed data. A total ~280 KiB. There's a few KiB of HTML but I don't know whether and how I should count that. Even if we take into account headers, padding, objects and higher quality data (e.g. 16 bits per sample), I assume all assets will still account for less than half a megabyte. Now that I look at the code, I see it's including a bundled version of jQuery. I don't know how big the representation of Javascript code is in memory, but 29 MiB seems a bit much (correction, while I was typing this, it went to 31 MiB). It might seems disingenuous to single out this extensions, but truth to be told all my extensions need a similar, way too high amount of private memory.
- jiggy2011 15y agoMost likely it's the javascript etc, it may also be holding syntax trees etc in memory too? If it causes the load of another library which nothing else was using that could count especially if it's a different version of jquery etc. If 2 processes are both using the same library and it is linked to their addresses spaces, who's memory usage does it count against?
- kmm 15y agoNeither, as I am only looking at private memory, which is by definition not shared. Interestingly, most of my extensions have 0K shared memory, which implies they're all keeping their own version of JavaScript libraries in their own memory space. That might explain most of the problem. It doesn't seem easy to solve a problem like this, without reinventing the shared library and the accompanying "DLL hell".
- sirclueless 15y agoAnd in fact the memory isolation between javascript execution contexts is one of Chrome's most touted security features.
- deleted 15y ago[deleted]