Skip to content
⌘ NSIS Forum Archive

Get a process memory usage by Pid

9 posts

r2du-soft#

Get a process memory usage by Pid

how can get a process memory usage by pid number?
Is there a plug-in for this job?
How to do this using System :: Call?

Anders#
Maybe try searching MSDN?

To obtain the current size of the working set of a specified process, use the GetProcessMemoryInfo function
r2du-soft#
Originally Posted by Anders View Post
Maybe try searching MSDN?
yes i searched msdn and stackoverflow but i did not get the final answer.
also i see your post
https://nsis-dev.github.io/NSIS-Forums/html/t-371381.html
but return values was not solve the my problem.
i can return private usage but the value is not true!

see my test please, the jetaudio.exe memory usage in taskmanager is 12744 kb but the return value by nsis is different:

r2du-soft#
For now, I've prepared a plugin for Get Process Private Memory:


Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
Anders#
Originally Posted by r2du-soft View Post
see my test please, the jetaudio.exe memory usage in taskmanager is 12744 kb but the return value by nsis is different
How am I supposed to reproduce any of this?

Run NSIS 3.04 setup and report the memory value you are after when on the welcome page and maybe I would have a chance. But it probably varies by Windows version. My taskmanager does not have a " the column Memory (active private working set)".
r2du-soft#
Originally Posted by Anders View Post
How am I supposed to reproduce any of this?

Run NSIS 3.04 setup and report the memory value you are after when on the welcome page and maybe I would have a chance. But it probably varies by Windows version. My taskmanager does not have a " the column Memory (active private working set)".
for display the column Memory (active private working set) you must open the task manager and goto Details tab, right click on column Name and then select columns,now you can check the Memory (active private working set).

Each program after re-run,Occupies a new usage memory in Ram
also yes! This is probably the case in different operating systems


this is usage memory in nsis welcome page in first run:





this is usage memory in nsis welcome page in Second run:




windows Version:
Anders#
Taskmanager calls NtQuerySystemInformation to get this information. With WMI this is supposedly Win32_PerfRawData_PerfProc_Process:WorkingSetPrivate and as you discovered, the "Working Set - Private" performance counter.