Jump to content

Is there a way to get this "Non-paged pool" number?


Recommended Posts

Hello,

Is there any way to get this "Non-paged pool" number like what is showing in Task Manager? (Please see picture below)

image.png.72effa7b555de19865043512c1095413.png

 

I've tried the script below but got "Subscript used on non-accessible variable." error when $i = 2
 

Func Get_sum_nonpaged_pool_usage()

    $sum_nonpaged_pool_usage = 0

    ; List all processes
    $list = ProcessList()
    for $i = 1 to $list[0][0]
        $aData = _WinAPI_GetProcessMemoryInfo($list[$i][1])
        $current_nonpaged_pool_usage_of_iPID = $aData[6] (==> Subscript used on non-accessible variable.)
        $sum_nonpaged_pool_usage = $sum_nonpaged_pool_usage + $current_nonpaged_pool_usage_of_iPID
    next

    Return $sum_nonpaged_pool_usage
EndFunc

 

Edited by AutoFan
Link to post
Share on other sites

Hi @AutoFan,

unfortunately you don't get memory information for each process. You can skip these ones by ContinueLoop and the @error makro.

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#AutoIt3Wrapper_Run_Au3Stripper=y
#Au3Stripper_Parameters=/sf /sv /mo /rm /rsln

#include-once
#include <Array.au3>
#include <WinAPIProc.au3>

ConsoleWrite(Get_sum_nonpaged_pool_usage() & @CRLF)

Func Get_sum_nonpaged_pool_usage()
    Local $sum_nonpaged_pool_usage = 0

    ; List all processes
    Local $list = ProcessList()

    For $i = 1 To $list[0][0] Step 1
        Local $aData = _WinAPI_GetProcessMemoryInfo($list[$i][1])
        If @error <> 0 Then ContinueLoop

        Local $current_nonpaged_pool_usage_of_iPID = $aData[6]

        $sum_nonpaged_pool_usage += $current_nonpaged_pool_usage_of_iPID

        ConsoleWrite($sum_nonpaged_pool_usage & @CRLF)
    Next

    Return $sum_nonpaged_pool_usage
EndFunc

Best regards,
Sven

Stay innovative!

Spoiler

🌍 Au3Forums

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔍 Forum search

🔮 Me on GitHub

💬 Opinion about new forum sub category

 📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to post
Share on other sites
12 hours ago, SOLVE-SMART said:

Hi @AutoFan,

unfortunately you don't get memory information for each process. You can skip these ones by ContinueLoop and the @error makro.

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#AutoIt3Wrapper_Run_Au3Stripper=y
#Au3Stripper_Parameters=/sf /sv /mo /rm /rsln

#include-once
#include <Array.au3>
#include <WinAPIProc.au3>

ConsoleWrite(Get_sum_nonpaged_pool_usage() & @CRLF)

Func Get_sum_nonpaged_pool_usage()
    Local $sum_nonpaged_pool_usage = 0

    ; List all processes
    Local $list = ProcessList()

    For $i = 1 To $list[0][0] Step 1
        Local $aData = _WinAPI_GetProcessMemoryInfo($list[$i][1])
        If @error <> 0 Then ContinueLoop

        Local $current_nonpaged_pool_usage_of_iPID = $aData[6]

        $sum_nonpaged_pool_usage += $current_nonpaged_pool_usage_of_iPID

        ConsoleWrite($sum_nonpaged_pool_usage & @CRLF)
    Next

    Return $sum_nonpaged_pool_usage
EndFunc

Best regards,
Sven

Thanks it can run without error, but it gives different number than the one in Task Manager. Guess I am in the wrong way...

Link to post
Share on other sites
20 hours ago, AutoFan said:

Thanks it can run without error, but it gives different number than the one in Task Manager. Guess I am in the wrong way...

How big is the difference? I think your approach is quite good. Do you really need the "nonpaged pool usage" for each process? Why?
Maybe an external tool which is more specialized in memory dump could help you?

Best regards
Sven

Stay innovative!

Spoiler

🌍 Au3Forums

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔍 Forum search

🔮 Me on GitHub

💬 Opinion about new forum sub category

 📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to post
Share on other sites
18 hours ago, SOLVE-SMART said:

How big is the difference? I think your approach is quite good. Do you really need the "nonpaged pool usage" for each process? Why?
Maybe an external tool which is more specialized in memory dump could help you?

Best regards
Sven

Very big, I got 9895868 bytes which equal to 9.895868 MB only while in task manager shows 1.0 GB Non-paged pool.

Could you tell me the name of that external tool ?

Thanks

Link to post
Share on other sites

I had non specific one in mind, to be honest. I didn't need such memory stuff since years, but I remember the usage of such mem dump tool. Maybe it was called MemDump or so. I guess a google search should bring up several free tools. Or you will get referred to a GitHub project.

Besides that, I can not help more regarding this. Maybe you will get more answers here by the other guys 🤞 .

Best regards
Sven

Edited by SOLVE-SMART

Stay innovative!

Spoiler

🌍 Au3Forums

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔍 Forum search

🔮 Me on GitHub

💬 Opinion about new forum sub category

 📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to post
Share on other sites
2 hours ago, SOLVE-SMART said:

I had non specific one in mind, to be honest. I didn't need such memory stuff since years, but I remember the usage of such mem dump tool. Maybe it was called MemDump or so. I guess a google search should bring up several free tools. Or you will get referred to a GitHub project.

Besides that, I can not help more regarding this. Maybe you will get more answers here by the other guys 🤞 .

Best regards
Sven

I'll do more research about this.

Thanks anyways !

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...