heapgen

package
v0.0.0-...-69adf43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(gen func() interface{}, bytes1, bytesGoal int) interface{}

Generate generates garbage by running gen() bytesGoal/bytes1 times. It returns an object that retains all objects returned by gen.

func MakeAST

func MakeAST() interface{}

MakeAST generates garbage by parsing the net/http source code. Each AST is ~1.8MB of heap.

func MakeDeBruijn2

func MakeDeBruijn2(power int) interface{}

MakeDeBruijn2 constructs a de Bruijn graph of objects of degree 2 with exactly 2**power nodes. Each node in the graph has exactly 2 out-edges and 2 in-edges and the diameter of the graph is power.

Types

type Measurement

type Measurement struct {
	// Gen is the garbage generator function used for this
	// Measurement.
	Gen func() interface{}

	// BytesRetained is the bytes of heap retained by the result
	// of Gen().
	BytesRetained int

	// ObjectsRetained is the number of objects retained by the
	// result of Gen().
	ObjectsRetained int

	// BytesGarbage is the bytes of non-retained garbage produced
	// by calling Gen().
	BytesGarbage int
}

func Measure

func Measure(gen func() interface{}) Measurement

Measure measures gen's effect on the heap. The system must be otherwise idle.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL