cockroachdb / cockroach

CockroachDB - the open source, cloud-native distributed SQL database.
https://www.cockroachlabs.com
Other
29.52k stars 3.7k forks source link

gopsutil: questionable cgo #31374

Open tbg opened 5 years ago

tbg commented 5 years ago

The upstream owner isn't submitting OSX patches, so for visibility this is the best place if we want it to get done:

https://github.com/shirou/gopsutil/blob/a11c78ba2c13c5b1ee59c53296ba35f92f0ce658/cpu/cpu_darwin_cgo.go#L30

Has a questionable vm_deallocate (uses ncpu instead of count). Chromium does this instead.

gosigar has the same code: https://github.com/cockroachdb/vendored/blob/master/github.com/elastic/gosigar/sigar_darwin.go#L134 (not sure if we call it).

Finally, https://github.com/cockroachdb/vendored/blob/master/github.com/shirou/gopsutil/mem/mem_darwin_cgo.go#L31 looks like it should also free some memory but it doesn't.

And as an actual "finally", there's already some badness we filed with gopsutil (as a result of which we don't use it for disk stats on OSX): https://github.com/shirou/gopsutil/issues/560

Might as well fix that too.

Jira issue: CRDB-4795

github-actions[bot] commented 7 months ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!