-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Measure USS on Windows #746
Conversation
This is based off the memory reporting implementation in Firefox. |
It would appear AppVeyor is unhappy about the usage of stdint.h on Windows, I'm guessing Visual C++ for Python 9 does not include it, but it was in my path due to having a full-fledged modern msvc install. |
Python 2.7 still has to be compiled with Visual Studio 2008 which does not support stdint.h. |
Related: #752 |
} | ||
|
||
return result; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation should be 4 spaces. Also, there's no need to put this in a separate file. You can use psutil/arch/windows/process_info.c
instead.
#include <psapi.h> | ||
|
||
BOOL | ||
calc_uss(DWORD target, unsigned long long* aN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a second thought I would prefer you define this in psutil/_psutil_windows.c
as proc_memory_uss
.
From the python file (psutil/_pswindows.py
) after you call cext.psutil_proc_memory_info
(or cext.psutil_proc_memory_info_2
you will call cext.proc_memory_uss
to get USS stats separately.
@giampaolo The latest pushes should cover your code review comments. |
DWORD info_array_size; | ||
PSAPI_WORKING_SET_INFORMATION* info_array; | ||
SYSTEM_INFO system_info; | ||
PyObject* result = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rename this to py_result
@giampaolo ee6024f should address the final comments. |
This adds a USS (unique set size, aka private working set) measurement to
memory_info_ex
on Windows.Performance before patch:
Performance after patch:
So slower, but not as bad as Linux and OSX.