-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix memory reporting on FreeBSD #106
Conversation
@michbsd thanks for this PR, travis found some formatting errors, can you take a look? You can fix them with |
sigar_freebsd.go
Outdated
if err != nil { | ||
return err | ||
} | ||
self.Free = uint64(val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this value the number of pages? Free
is expected to be in bytes, we should probably multiply here by pagesize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's done later down:
self.Used = self.Total - (self.Free * pagesize)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I mean to store the size in bytes in self.Free, i.e:
self.Free = uint64(val) * pagesize
self.Free
is the value that will be used at the end for the free memory metrics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha. fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it looks good now :)
ping - any news on this? |
@michbsd merged, sorry for the delay! |
and move (self *Mem) function from sigar_linux_common to sigar_linux