Copyright 2018 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package profiler
import (
)
heapProfile collects an in-use heap profile. The heap profiles returned by the runtime also include the heap allocation metrics. We zero those out since all allocations since program start are recorded, so these make the profile large and there is a separate alloc profile type which shows allocations from a set duration.
deltaAllocProfile collects an allocation profile by gathering a heap profile, sleeping for the specified duration, gathering another heap profile and subtracting the initial one from that. It then drops the in-use metrics from the profile. If requested, it forces the GC before taking each of the heap profiles, which improves the profile accuracy (see docs in https://golang.org/src/runtime/mprof.go on why).
The pages are generated with Goldsv0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.