Why Google Chrome is reserving Terabytes scale virtual memory?

My system was running slow recently and I checked htop to identify resource consumption. RES Column is 213M which is quite normal for chrome. I was surprised after looking at VIRT column, Google Chrome was taking 1.1T !!!

I killed chrome and open again and still it was using 1.1T VIRT memory. Any pointer would be helpful if Higher VIRT is not normal and need to be fixed.

Laptop Hardware details.

Processor Intel® Core™ i3-4005U CPU @ 1.70GHz × 4 
Graphics NVD7 / Intel® HD Graphics 4400 (HSW GT2)
Memory 7.7 GiB
Disk Capacity 740.2 GB
// uname -srvmpio
Linux 5.13.0-41-generic #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
// Google Chrome version
Version 102.0.5005.61 (Official Build) (64-bit)

Google Chrome taking 1.1T Virtual Memory

Asked By: Milan

||

Please disregard VIRT. I’ve never used or seen anyone use or pay attention to it ever.

It basically means nothing. No idea why top/htop still show it.

Mugurel Sumanariu once wrote about it:

VIRT stands for the virtual size of a process, which is the sum of memory it is actually using, memory it has mapped into itself (for instance the video card’s RAM for the X server), files on disk that have been mapped into it (most notably shared libraries), and memory shared with other processes. VIRT represents how much memory the program is able to access at the present moment.

(On a system where memory overcommit is disabled it could mean something but you wouldn’t want to use such a system).

Answered By: Artem S. Tashkinov

This is because of a Chrome security feature called Caged Pointers. The idea is you put all Javascript objects inside this huge virtual address space, and all browser private stuff outside it, and then you can easily detect if someone tries to break out of the Javascript sandbox.

See https://docs.google.com/document/d/1HSap8-J3HcrZvT7-5NsbYWcjfc0BVoops5TDHZNsnko/edit

Answered By: ali1234
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.