Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Fix memstats to return allocated heap size rather than with overhead (#9
Browse files Browse the repository at this point in the history
)
  • Loading branch information
anuraaga authored Mar 22, 2023
1 parent cc14da1 commit 436d446
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func ReadMemStats(ms *runtime.MemStats) {
gcOSBytes := C.GC_get_obtained_from_os_bytes()

ms.Sys = uint64(peakRSS + gcOSBytes)
ms.HeapSys = uint64(gcOSBytes)
ms.HeapSys = uint64(heapSize)
ms.HeapIdle = uint64(freeBytes)
ms.HeapReleased = uint64(unmappedBytes)
ms.TotalAlloc = uint64(totalBytes)
Expand Down

0 comments on commit 436d446

Please # to comment.