You've already forked go-profiler-notes
mirror of
https://github.com/DataDog/go-profiler-notes.git
synced 2025-07-15 23:54:16 +02:00
hack
This commit is contained in:
@ -151,7 +151,7 @@ pprof.StartCPUProfile(file)
|
|||||||
defer pprof.StopCPUProfile()
|
defer pprof.StopCPUProfile()
|
||||||
```
|
```
|
||||||
|
|
||||||
Regardless of how you activate the CPU profiler, the resulting profile will be a frequency table of stack traces formatted in the binary [pprof](../pprof.md) format. A simplified version of such a table is shown below:
|
Regardless of how you activate the CPU profiler, the resulting profile will essentially be a table of stack traces formatted in the binary [pprof](../pprof.md) format. A simplified version of such a table is shown below:
|
||||||
|
|
||||||
|stack trace|samples/count|cpu/nanoseconds|
|
|stack trace|samples/count|cpu/nanoseconds|
|
||||||
|-|-|-|
|
|-|-|-|
|
||||||
@ -239,10 +239,10 @@ If you need a quick snippet to paste into your `main()` function, you can use th
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
file, _ := os.Create("./mem.pprof")
|
file, _ := os.Create("./mem.pprof")
|
||||||
pprof.Lookup("heap").WriteTo(file, 0)
|
defer pprof.Lookup("heap").WriteTo(file, 0)
|
||||||
```
|
```
|
||||||
|
|
||||||
Regardless of how you activate the Memory profiler, the resulting profile will be a table of stack traces formatted in the binary [pprof](../pprof.md) format. A simplified version of such a table is shown below:
|
Regardless of how you activate the Memory profiler, the resulting profile will essentially be a table of stack traces formatted in the binary [pprof](../pprof.md) format. A simplified version of such a table is shown below:
|
||||||
|
|
||||||
|stack trace|alloc_objects/count|alloc_space/bytes|inuse_objects/count|inuse_space/bytes|
|
|stack trace|alloc_objects/count|alloc_space/bytes|inuse_objects/count|inuse_space/bytes|
|
||||||
|-|-|-|-|-|
|
|-|-|-|-|-|
|
||||||
@ -250,7 +250,12 @@ Regardless of how you activate the Memory profiler, the resulting profile will b
|
|||||||
|main;foo;bar|3|768|0|0|
|
|main;foo;bar|3|768|0|0|
|
||||||
|main;foobar|4|512|1|128|
|
|main;foobar|4|512|1|128|
|
||||||
|
|
||||||
The memory profiler is implemented by
|
The memory profile contains two major pieces of information:
|
||||||
|
|
||||||
|
- `alloc_*`: The amount of allocations that your program has made since the start of the process (or profiling period for delta profiles).
|
||||||
|
- `insue_*`: The amount of allocations that your program has made that were still reachable during the last GC.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
func malloc(size):
|
func malloc(size):
|
||||||
@ -275,7 +280,7 @@ func sweep(object):
|
|||||||
return object
|
return object
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Memory Inuse vs RSS
|
||||||
|
|
||||||
### Known Memory Profiler Issues
|
### Known Memory Profiler Issues
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user