Merged
Conversation
The ReadJEMallocStats function can be used to fetch JE Malloc statistics at runtime.
ashish-goswami
approved these changes
Sep 8, 2020
Contributor
ashish-goswami
left a comment
There was a problem hiding this comment.
Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @anurags92, @jarifibrahim, @karlmcguire, @manishrjain, and @martinmr)
z/calloc_jemalloc.go, line 86 at r1 (raw file):
func ReadJEMallocStats(stats *JEMallocStats) { if stats == nil { panic("function argument should not be nil")
See if we can avoid panic here.
z/calloc_jemalloc.go, line 95 at r1 (raw file):
// fetchStat is used to read a specific attribute from je malloc stats using // mallctl.
can be fit into same line.
manishrjain
approved these changes
Sep 8, 2020
Contributor
manishrjain
left a comment
There was a problem hiding this comment.
Nice change. Got some comments.
Reviewed 2 of 3 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @anurags92, @jarifibrahim, @karlmcguire, and @martinmr)
z/calloc.go, line 15 at r2 (raw file):
// JEMallocStats is used to fetch JE Malloc Stats. The stats are fetched from // the mallctl namespace http://jemalloc.net/jemalloc.3.html#mallctl_namespace. type JEMallocStats struct {
MemStats
z/calloc_jemalloc.go, line 84 at r2 (raw file):
// ReadJEMallocStats populates stats with JE Malloc statistics. func ReadJEMallocStats(stats *JEMallocStats) {
ReadMemStats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JE Malloc is used to manually allocate memory. This PR adds a
ReadMemStatsfunction (similar to runtime.ReadMemStats) that can be used to fetch JE Malloc statistics at runtime.
This PR supports fetching
Allocated, Active, Retained, and Residentmemory information.Fixes - DGRAPH-2382
This change is