Old 29th April 2019, 22:46   #1
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 334
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?

r2du-soft is offline   Reply With Quote
Old 29th April 2019, 23:07   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,097
Memory usage meaning what? Which column in Process Explorer are you interested in?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 29th April 2019, 23:33   #3
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 334
i need to read the column Memory (active private working set) a process by pid number
r2du-soft is offline   Reply With Quote
Old 30th April 2019, 00:18   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,097
Maybe try searching MSDN?


IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 30th April 2019, 23:31   #5
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 334
Quote:
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
HTML Code:
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 is offline   Reply With Quote
Old 30th April 2019, 23:36   #6
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 334
For now, I've prepared a plugin for Get Process Private Memory:


http://forums.winamp.com/showthread.php?t=454590
r2du-soft is offline   Reply With Quote
Old 1st May 2019, 00:14   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,097
Quote:
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)".

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 2nd May 2019, 19:32   #8
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 334
Quote:
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:
Attached Thumbnails
Click image for larger version

Name:	2019-05-03_0-01-42.jpg
Views:	91
Size:	58.5 KB
ID:	54437   Click image for larger version

Name:	1.jpg
Views:	92
Size:	209.6 KB
ID:	54440   Click image for larger version

Name:	2.jpg
Views:	88
Size:	205.8 KB
ID:	54441  
r2du-soft is offline   Reply With Quote
Old 2nd May 2019, 23:59   #9
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,097
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump