fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

Clarify heap profile trigger (#851)

The heap profile is triggered when total heap allocated (inuse + garbage
objects) passes a certain threshold. However, the profiles are mainly useful
for looking at `inuse_space`. This PR improves the docs to make this a tiny bit
less confusing.

+4 -2
+4 -2
build/builder.go
··· 119 119 // Sourcegraph specific option. 120 120 ShardMerging bool 121 121 122 - // HeapProfileTriggerBytes is the heap usage in bytes that will trigger a memory profile. If 0, no memory profile will be triggered. 122 + // HeapProfileTriggerBytes is the heap allocation in bytes that will trigger a memory profile. If 0, no memory profile 123 + // will be triggered. Note this trigger looks at total heap allocation (which includes both inuse and garbage objects). 124 + // 123 125 // Profiles will be written to files named `index-memory.prof.n` in the index directory. No more than 10 files are written. 124 126 // 125 127 // Note: heap checking is "best effort", and it's possible for the process to OOM without triggering the heap profile. ··· 1023 1025 if m.HeapAlloc > b.opts.HeapProfileTriggerBytes && b.heapProfileMu.TryLock() { 1024 1026 defer b.heapProfileMu.Unlock() 1025 1027 1026 - log.Printf("writing memory profile, heap usage: %s", humanize.Bytes(m.HeapAlloc)) 1028 + log.Printf("writing memory profile, allocated heap: %s", humanize.Bytes(m.HeapAlloc)) 1027 1029 name := filepath.Join(b.opts.IndexDir, fmt.Sprintf("indexmemory.prof.%d", b.heapProfileNum)) 1028 1030 f, err := os.Create(name) 1029 1031 if err != nil {