Hardware

Keeping an eye on Chrome's memory usage

Keeping track of Chrome's memory usage is easier said than done when it is spread over multiple processes.

One of the identifying marks of Chrome is its multi-process architecture that loads each tab and plug-in in a separate operating system process.

While the process isolation gives the browser better stability and security, it is harder to keep track of Chrome's total memory usage, especially if you like to sort running applications by used memory percentage.

Before we get to that point, you can use Chrome's built-in tools to track memory usage, if absolute values are your preference.

First up, you can try Chrome's Task Manager, which hides under the Tools menu.

But I prefer using Chrome's "About memory" page, which is accessible via the about:memory or chrome://memory-redirect/ URLs. I like that Chrome includes the memory usage of other browsers for comparison.


(Click to enlarge)
(Screenshot by Chris Duckett/TechRepublic)

For those who prefer used memory as a percentage, I used the following line in Linux to sum up Chromium's memory use:

ps -eo pmem,comm | grep chromium | cut -d " " -f 2 | paste -sd+ | bc

To break it down, the -e flag on the ps command shows all processes, and -o pmem, comm option makes ps output only the used memory and command columns. That output is then restricted to only Chromium processes via grep.

Since I only want to sum up the memory used column, I use cut to reduce the output to a column of numbers representing memory used.

Then paste is used with the -s option to reduce the list to a single line, and -d+ is used to change the delimiter from a space to a plus sign.

At this point, we have a string in the form of a+b+c+d+e, so to actually do the summation, I pipe that into bc, the basic calculator.

The output of this command was a little shocking when I first ran it.


Chrome performs well when you feed it RAM (click to enlarge)
(Screenshot by Chris Duckett/TechRepublic)

Over 40 per cent of my computer's memory is being used by Chromium! It's hard to notice the total memory used in top when all of those individual processes take up 3 per cent to 5 per cent each.

Maybe Chromium should follow Mozilla's lead, and have its own project MemShrink.

About

Some would say that it is a long way from software engineering to journalism, others would correctly argue that it is a mere 10 metres according to the floor plan.During his first five years with CBS Interactive, Chris started his journalistic advent...

1 comments
OurITLady
OurITLady

I started using Chrome a while ago, seemed pretty fast response at first but I have noticed it seems to have slowed down considerably in the last month or two. I thought it was my machine, good to know that it's potentially the memory usage (although I have 6GB in a 64-bit windows machine). At least now I have somewhere to check memory usage a little more easily, I had tried checking and noticed the multiple processes, gave up on the addition as it was getting late at the time.

Editor's Picks