Documentation
¶
Overview ¶
Package capture writes the calling process's heap dump to a temp file and returns it positioned at offset 0. It is used by dev tools and tests that need a live heap dump without the snapshot-tar bundle format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaptureOptions ¶
type CaptureOptions struct {
// GCBeforeHeapDump runs runtime.GC() before WriteHeapDump.
GCBeforeHeapDump bool
// HeapDumpWriter writes the heap dump. Defaults to
// RuntimeHeapDumpWriter when nil.
HeapDumpWriter HeapDumpWriter
// GC is the GC trigger. Defaults to runtime.GC when nil.
GC func()
}
CaptureOptions configures Capture. The zero value is useful: it selects RuntimeHeapDumpWriter and skips the GC.
type Captured ¶
type Captured struct {
HeapDump *os.File
HeapDumpSize int64
// contains filtered or unexported fields
}
Captured holds a heap dump open as a seeked-to-zero temp file. Call Cleanup when done.
type HeapDumpWriter ¶
HeapDumpWriter writes the calling process heap dump to the file identified by fd.
type RuntimeHeapDumpWriter ¶
type RuntimeHeapDumpWriter struct{}
RuntimeHeapDumpWriter is the production HeapDumpWriter: it calls debug.WriteHeapDump with the supplied file descriptor.
func (RuntimeHeapDumpWriter) WriteHeapDump ¶
func (RuntimeHeapDumpWriter) WriteHeapDump(fd uintptr) error
Click to show internal directories.
Click to hide internal directories.