dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.25k stars 1.58k forks source link

VM Service: Gather virtual memory mappings from other operating systems #46166

Open rmacnak-google opened 3 years ago

rmacnak-google commented 3 years ago

GetProcessMemoryUsage on Linux/Android now adds virtual memory mappings gather from /proc/self/smaps. Together with the VM's own accounting of its anonymous mappings, this explains nearly all the processes's RSS.

On Fuchsia, we can gather similar information by walking zx_object_get_info(zx_process_self(), ZX_INFO_PROCESS_MAPS).

On Windows, some combination of VirtualQuery, GetMappedFileName, EnumModules should provide similar information.

On Mac, we may need to parse the output of vmmap, though this might be unacceptably slow.

a-siva commented 3 years ago

//cc @bkonyi