Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The method Profiler Framework calculate the memory seems less accurate than the method from debugserver. #53

Closed
YY-Wei opened this issue Sep 19, 2019 · 1 comment

Comments

@YY-Wei
Copy link

YY-Wei commented Sep 19, 2019

The method Profiler Framework calculate the memory (https://github.com/wix/DetoxInstruments/blob/master/Profiler/DTXProfiler/PerformanceProfiling/DTXPerformanceSampler.m#L210)

result == KERN_SUCCESS ? task_vm_info.internal + task_vm_info.compressed : 0;
It doesn't seem that precise。

The memory profile method from debugserver seems more accurate.

anonymous = vm_info.internal + vm_info.compressed - vm_info.purgeable_volatile_pmap;

The value of anonymous is the same as the value of memory usage in Xcode Debug.
(https://github.com/llvm-mirror/lldb/blob/master/tools/debugserver/source/MacOSX/MachVMMemory.cpp#L144)

@LeoNatan LeoNatan added this to Planned in General via automation Sep 19, 2019
@LeoNatan
Copy link
Contributor

Very interesting, thank you!
I will test and make the change soon.

General automation moved this from Planned to Done Sep 19, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 22, 2019
@LeoNatan LeoNatan added enhancement and removed bug labels Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
General
  
Done
Development

No branches or pull requests

2 participants