macbookpro:tejia_analysis fredlee$ go tool pprof http://ip:6065/debug/pprof/heap
Fetching profile over HTTP from http://ip:6065/debug/pprof/heap
Saved profile in /Users/fredlee/pprof/pprof.tejia_analysis.alloc_objects.alloc_space.inuse_objects.inuse_space.006.pb.gz
File: tejia_analysis
Type: inuse_space
Time: Jul 30, 2020 at 2:03pm (CST)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) top20 -cum
Showing nodes accounting for 2509.12MB, 98.97% of 2535.11MB total
Dropped 37 nodes (cum <= 12.68MB)
flat flat% sum% cum cum%
0 0% 0% 2533.11MB 99.92% app_server/util.(*Analysis).Job
0 0% 0% 2533.11MB 99.92% app_server/util.(*Analysis).Start
1007.72MB 39.75% 39.75% 2523.10MB 99.53% app_server/util.(*Analysis).LoadSearchLog
0 0% 39.75% 1466.37MB 57.84% go.mongodb.org/mongo-driver/bson.(*Decoder).Decode
0 0% 39.75% 1466.37MB 57.84% go.mongodb.org/mongo-driver/bson.UnmarshalWithRegistry
0 0% 39.75% 1466.37MB 57.84% go.mongodb.org/mongo-driver/bson.unmarshalFromReader
0 0% 39.75% 1466.37MB 57.84% go.mongodb.org/mongo-driver/bson/bsoncodec.(*StructCodec).DecodeValue
0 0% 39.75% 1466.37MB 57.84% go.mongodb.org/mongo-driver/mongo.(*Cursor).Decode (inline)
0 0% 39.75% 1457.37MB 57.49% go.mongodb.org/mongo-driver/bson/bsoncodec.(*StringCodec).DecodeValue
0 0% 39.75% 1457.37MB 57.49% go.mongodb.org/mongo-driver/bson/bsonrw.(*valueReader).ReadString
1457.37MB 57.49% 97.24% 1457.37MB 57.49% go.mongodb.org/mongo-driver/bson/bsonrw.(*valueReader).readString
0 0% 97.24% 44.03MB 1.74% net/url.ParseQuery (inline)
44.03MB 1.74% 98.97% 44.03MB 1.74% net/url.parseQuery
(pprof) list LoadSearchLog
Total: 2.48GB
ROUTINE ======================== app_server/util.(*Analysis).LoadSearchLog in app_server/util/analysis.go
1007.72MB 2.46GB (flat, cum) 99.53% of Total
Error: could not find file app_server/util/analysis.go on path /Users/fredlee/Documents/tool/tejia_analysis
macbookpro:tejia_analysis fredlee$ pwd
/Users/fredlee/Documents/xxx/tool/tejia_analysis
macbookpro:tejia_analysis fredlee$ tree util
util
├── analysis.go
├── configure.go
├── cron.go
├── job_discount.go
├── kv_bolt.go
├── mongo_client.go
├── mongo_globalairport.go
├── mysql_aircompany.go
├── mysql_client.go
├── mysql_convertcode.go
├── mysql_icmmgt_top_route.go
└── redis_client.go
0 directories, 12 files
macbookpro:tejia_analysis fredlee$ cat go.mod
module app_server
go 1.14