Merge pull request #734 from cobolbaby/master

fix: process_resident_memory_bytes detected is incorrect in Win7 32bit
This commit is contained in:
Björn Rabenstein 2020-04-13 13:43:00 +02:00 committed by GitHub
commit efb148ca4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 10 deletions

View File

@ -33,18 +33,22 @@ var (
) )
type processMemoryCounters struct { type processMemoryCounters struct {
// https://docs.microsoft.com/en-us/windows/desktop/api/psapi/ns-psapi-_process_memory_counters_ex // System interface description
// https://docs.microsoft.com/en-us/windows/desktop/api/psapi/ns-psapi-process_memory_counters_ex
// Refer to the Golang internal implementation
// https://golang.org/src/internal/syscall/windows/psapi_windows.go
_ uint32 _ uint32
PageFaultCount uint32 PageFaultCount uint32
PeakWorkingSetSize uint64 PeakWorkingSetSize uintptr
WorkingSetSize uint64 WorkingSetSize uintptr
QuotaPeakPagedPoolUsage uint64 QuotaPeakPagedPoolUsage uintptr
QuotaPagedPoolUsage uint64 QuotaPagedPoolUsage uintptr
QuotaPeakNonPagedPoolUsage uint64 QuotaPeakNonPagedPoolUsage uintptr
QuotaNonPagedPoolUsage uint64 QuotaNonPagedPoolUsage uintptr
PagefileUsage uint64 PagefileUsage uintptr
PeakPagefileUsage uint64 PeakPagefileUsage uintptr
PrivateUsage uint64 PrivateUsage uintptr
} }
func getProcessMemoryInfo(handle windows.Handle) (processMemoryCounters, error) { func getProcessMemoryInfo(handle windows.Handle) (processMemoryCounters, error) {