Function Reference


_WinAPI_GetPerformanceInfo

Retrieves the performance information

#include <WinAPISys.au3>
_WinAPI_GetPerformanceInfo ( )

Return Value

Success: The array containing the following information:
[0] - The memory that currently committed by the system, in bytes.
[1] - The current maximum memory that can be committed by the system without extending the paging file(s), in bytes.
[2] - The maximum memory that were simultaneously in the committed state since the last system reboot, in bytes.
[3] - The amount of actual physical memory, in bytes.
[4] - The amount of physical memory currently available, in bytes.
[5] - The amount of system cache memory, in bytes.
[6] - The sum of the memory currently in the paged and nonpaged kernel pools, in bytes.
[7] - The memory currently in the paged kernel pool, in bytes.
[8] - The memory currently in the nonpaged kernel pool, in bytes.
[9] - The size of a page, in bytes.
[10] - The current number of open handles.
[11] - The current number of processes.
[12] - The current number of threads.
Failure: Sets the @error flag to non-zero, call _WinAPI_GetLastError() to get extended error information.

See Also

Search GetPerformanceInfo in MSDN Library.

Example

#include <WinAPISys.au3>

Local $aData = _WinAPI_GetPerformanceInfo()

ConsoleWrite('Physical Memory (MB)' & @CRLF)
ConsoleWrite('--------------------' & @CRLF)
ConsoleWrite('Total:     ' & Floor($aData[3] / 1024 / 1024) & @CRLF)
ConsoleWrite('Available: ' & Floor($aData[4] / 1024 / 1024) & @CRLF)
ConsoleWrite('Cached:    ' & Floor($aData[5] / 1024 / 1024) & @CRLF)
ConsoleWrite('Free:      ' & Floor($aData[6] / 1024 / 1024) & @CRLF)

ConsoleWrite(@CRLF)

ConsoleWrite('Kernel Memory (MB)' & @CRLF)
ConsoleWrite('--------------------' & @CRLF)
ConsoleWrite('Paged:     ' & Floor($aData[7] / 1024 / 1024) & @CRLF)
ConsoleWrite('Nonpaged:  ' & Floor($aData[8] / 1024 / 1024) & @CRLF)

ConsoleWrite(@CRLF)

ConsoleWrite('System' & @CRLF)
ConsoleWrite('--------------------' & @CRLF)
ConsoleWrite('Handles:   ' & $aData[10] & @CRLF)
ConsoleWrite('Processes: ' & $aData[11] & @CRLF)
ConsoleWrite('Threads:   ' & $aData[12] & @CRLF)