Comment #14 on issue 2191 by [email protected]: V8 reports heap memory size bigger than process private memory
http://code.google.com/p/v8/issues/detail?id=2191

"If you are interested in memory consumption you should look at used bytes (confusingly called "live" in the column) not heap size."

Unfortunately this is not enough for our purposes. We need to show all the physical memory committed for V8 heap. And it might be up to 2x higher than the size of actually allocated heap objects.

"We can even reorder these numbers inside the column to put an emphasis on the right thing: used matters --- heap size matters less."

Well, it's up to you. Probably you're right.

"And once again: V8 does not report amount of virtual address space it just reserves. Otherwise it would be _way_ higher. It reports amount of memory it asked OS to commit. It is true that OS can be lazy in performing actual commit, but that is something beyond V8's reach and actually is not important to V8 at all as for V8 purposes this memory looks like successfully committed and can be used for allocation ."

Although it's not that important for v8 (or even for task manager) you can show apples and oranges to the user. But this is important for DevTools because we're trying to show the user both apples and oranges on the same chart and even subtracting one from another. Which is obviously wrong.

"Would you prefer V8 to workaround OSes lazyness by touching every page inside the region it commits to make numbers of apples and oranges agree? I can hardly see any reason in that."

Of course not! Increasing process physical memory consumption for the sake of numbers match in the task manager is not an option. :-)

As a bottomline it seems that unfortunately Heap::CommittedMemory is not ok for our purposes. So I'm implementing Heap::CommittedPhysicalMemory function that we will call from DevTools.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to