Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
baf53840
Commit
baf53840
authored
Mar 26, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pprof: dump extra heap information at end of heap profile
R=r CC=golang-dev
https://golang.org/cl/786041
parent
f375791a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
pprof.go
src/pkg/runtime/pprof/pprof.go
+24
-0
No files found.
src/pkg/runtime/pprof/pprof.go
View file @
baf53840
...
@@ -69,5 +69,29 @@ func WriteHeapProfile(w io.Writer) os.Error {
...
@@ -69,5 +69,29 @@ func WriteHeapProfile(w io.Writer) os.Error {
}
}
fmt
.
Fprintf
(
b
,
"
\n
"
)
fmt
.
Fprintf
(
b
,
"
\n
"
)
}
}
// Print memstats information too.
// Pprof will ignore, but useful for people.
s
:=
&
runtime
.
MemStats
fmt
.
Fprintf
(
b
,
"
\n
# runtime.MemStats
\n
"
)
fmt
.
Fprintf
(
b
,
"# Alloc = %d
\n
"
,
s
.
Alloc
)
fmt
.
Fprintf
(
b
,
"# TotalAlloc = %d
\n
"
,
s
.
TotalAlloc
)
fmt
.
Fprintf
(
b
,
"# Sys = %d
\n
"
,
s
.
Sys
)
fmt
.
Fprintf
(
b
,
"# Stacks = %d
\n
"
,
s
.
Stacks
)
fmt
.
Fprintf
(
b
,
"# InusePages = %d
\n
"
,
s
.
InusePages
)
fmt
.
Fprintf
(
b
,
"# NextGC = %d
\n
"
,
s
.
NextGC
)
fmt
.
Fprintf
(
b
,
"# HeapAlloc = %d
\n
"
,
s
.
HeapAlloc
)
fmt
.
Fprintf
(
b
,
"# Lookups = %d
\n
"
,
s
.
Lookups
)
fmt
.
Fprintf
(
b
,
"# Mallocs = %d
\n
"
,
s
.
Mallocs
)
fmt
.
Fprintf
(
b
,
"# PauseNs = %d
\n
"
,
s
.
PauseNs
)
fmt
.
Fprintf
(
b
,
"# NumGC = %d
\n
"
,
s
.
NumGC
)
fmt
.
Fprintf
(
b
,
"# EnableGC = %v
\n
"
,
s
.
EnableGC
)
fmt
.
Fprintf
(
b
,
"# DebugGC = %v
\n
"
,
s
.
DebugGC
)
fmt
.
Fprintf
(
b
,
"# BySize = Size * (Active = Mallocs - Frees)
\n
"
)
for
_
,
t
:=
range
s
.
BySize
{
if
t
.
Mallocs
>
0
{
fmt
.
Fprintf
(
b
,
"# %d * (%d = %d - %d)
\n
"
,
t
.
Size
,
t
.
Mallocs
-
t
.
Frees
,
t
.
Mallocs
,
t
.
Frees
)
}
}
return
b
.
Flush
()
return
b
.
Flush
()
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment