Is there a memory leak here?


(护群神兽之点赞狂魔) #1

profile001.pdf (36.0 KB)

go tool pprof --alloc_space --text http://localhost:8080/debug/pprof/heap >heap.log

heap.log

File: dgraph
Build ID: 10ae31734c629ed7885fa2a2831cf2fe8c11bf04
Type: alloc_space
Time: Sep 28, 2018 at 11:21am (CST)
Showing nodes accounting for 491551.67MB, 91.84% of 535253.68MB total
Dropped 600 nodes (cum <= 2676.27MB)
      flat  flat%   sum%        cum   cum%
174450.26MB 32.59% 32.59% 200174.94MB 37.40%  github.com/dgraph-io/dgraph/bp128.dunpack256_57 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
74395.30MB 13.90% 46.49% 487039.70MB 90.99%  github.com/dgraph-io/dgraph/tok.init /home/travis/gopath/src/github.com/dgraph-io/dgraph/tok/stopwords.go
48981.77MB  9.15% 55.64% 48981.77MB  9.15%  github.com/dgraph-io/dgraph/bp128.dunpack256_56 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
32522.39MB  6.08% 61.72% 139330.25MB 26.03%  github.com/dgraph-io/dgraph/bp128.dunpack256_58 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
30710.25MB  5.74% 67.46% 30710.25MB  5.74%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson.ErrDimensionalityTooLow.Error /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson/geojson.go
25778.19MB  4.82% 72.27% 25778.19MB  4.82%  github.com/dgraph-io/dgraph/bp128.dunpack256_14 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
24658.77MB  4.61% 76.88% 24658.77MB  4.61%  github.com/prometheus/client_golang/prometheus.makeLabelPairs /home/travis/gopath/src/github.com/prometheus/client_golang/prometheus/value.go
17743.79MB  3.32% 80.19% 17743.79MB  3.32%  net/http.(*transferWriter).probeRequestBody /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/transfer.go
11496.85MB  2.15% 82.34% 11496.85MB  2.15%  compress/flate.(*decompressor).moreBits /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/compress/flate/inflate.go
 8961.37MB  1.67% 84.02%  9120.88MB  1.70%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb.Read /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/multilinestring.go
 8108.77MB  1.51% 85.53%  8108.77MB  1.51%  github.com/prometheus/client_golang/prometheus.(*constSummary).Write /home/travis/gopath/src/github.com/prometheus/client_golang/prometheus/summary.go
 5962.68MB  1.11% 86.64%  6145.70MB  1.15%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson.unmarshalCoords1 /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson/geojson.go
 5420.67MB  1.01% 87.66%  5420.67MB  1.01%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.length2 /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/flat_length.go
 4724.11MB  0.88% 88.54%  4724.11MB  0.88%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.(*LinearRing).Clone /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/linearring.go
 3640.31MB  0.68% 89.22%  4215.81MB  0.79%  crypto/rsa.init /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/crypto/rsa/rsa.go
 2995.63MB  0.56% 89.78%  3297.14MB  0.62%  github.com/dgraph-io/dgo/protos/api.(*Request).Unmarshal /home/travis/gopath/src/github.com/dgraph-io/dgo/protos/api/api.pb.go
 1963.74MB  0.37% 90.15% 73711.99MB 13.77%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.Coord.Equal /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/geom.go
 1463.53MB  0.27% 90.42%  9889.58MB  1.85%  github.com/dgraph-io/dgo/protos/api.(*Facet).MarshalTo /home/travis/gopath/src/github.com/dgraph-io/dgo/protos/api/api.pb.go
 1306.56MB  0.24% 90.66%  6800.02MB  1.27%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkbcommon.ReadFlatCoords2 /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkbcommon/wkbcommon.go
 1112.10MB  0.21% 90.87%  4463.40MB  0.83%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb.Write /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb/wkb.go
 1088.25MB   0.2% 91.08% 63267.41MB 11.82%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson.(*Geometry).Decode /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson/geojson.go
  970.69MB  0.18% 91.26%  3488.38MB  0.65%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson.Encode /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson/geojson.go
  946.06MB  0.18% 91.43%  2807.42MB  0.52%  net/http.(*Server).ServeTLS /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/server.go
  673.52MB  0.13% 91.56%  4569.89MB  0.85%  github.com/dgraph-io/dgo/protos/api.(*Facet).Size /home/travis/gopath/src/github.com/dgraph-io/dgo/protos/api/api.pb.go
  422.51MB 0.079% 91.64% 11639.06MB  2.17%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb.Read /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb/wkb.go
  275.51MB 0.051% 91.69% 92285.62MB 17.24%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.(*MultiPolygon).Clone /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/multipolygon.go
  200.01MB 0.037% 91.73%  5270.87MB  0.98%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb.Read /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/multipoint.go
  187.56MB 0.035% 91.76%  4816.73MB   0.9%  net/http.(*Transport).dialConn /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/transport.go
  186.50MB 0.035% 91.80%  5335.84MB     1%  net/http.(*Response).Write /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/response.go
      84MB 0.016% 91.81%  4608.74MB  0.86%  github.com/prometheus/client_golang/prometheus.newSummary /home/travis/gopath/src/github.com/prometheus/client_golang/prometheus/summary.go
   61.50MB 0.011% 91.82% 281511.60MB 52.59%  github.com/dgraph-io/dgraph/bp128.dunpack256_59 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
      25MB 0.0047% 91.83% 18678.26MB  3.49%  net/http.(*Transport).RoundTrip /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/transport.go
      17MB 0.0032% 91.83% 17813.31MB  3.33%  net/http.readRequest /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/request.go
   11.50MB 0.0021% 91.83%  5352.15MB     1%  net/http.readTransfer /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/transfer.go
       3MB 0.00056% 91.83%  4194.52MB  0.78%  github.com/golang/protobuf/proto.size_slice_string /home/travis/gopath/src/github.com/golang/protobuf/proto/encode.go
       2MB 0.00037% 91.84%  6877.72MB  1.28%  net/http.(*Request).ParseForm /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/request.go
         0     0% 91.84%  7459.23MB  1.39%  compress/flate.(*decompressor).huffSym /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/compress/flate/inflate.go
         0     0% 91.84%  4215.81MB  0.79%  encoding/asn1.makeField /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/encoding/asn1/asn1.go
         0     0% 91.84%  4226.65MB  0.79%  fmt.Fprintf /usr/local/go/src/fmt/print.go
         0     0% 91.84%  3698.33MB  0.69%  github.com/dgraph-io/dgo/protos/api.(*Value_DateVal).Size /home/travis/gopath/src/github.com/dgraph-io/dgo/protos/api/api.pb.go
         0     0% 91.84%  8426.04MB  1.57%  github.com/dgraph-io/dgraph/vendor/github.com/blevesearch/segment.segmentWords segment_words.rl
         0     0% 91.84%  6259.21MB  1.17%  github.com/dgraph-io/dgraph/vendor/github.com/gogo/protobuf/proto.(*Buffer).enc_new_map.func1 /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/gogo/protobuf/proto/encode.go
         0     0% 91.84%  6425.61MB  1.20%  github.com/dgraph-io/dgraph/vendor/github.com/gogo/protobuf/proto.(*Properties).Parse /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/gogo/protobuf/proto/properties.go
         0     0% 91.84%  5437.86MB  1.02%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.(*MultiLineString).Swap /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/multilinestring.go
         0     0% 91.84%  7100.01MB  1.33%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.(*MultiPoint).Swap /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/flat_geom1.go
         0     0% 91.84% 17716.82MB  3.31%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.Coord.Set /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/geom.go
         0     0% 91.84% 56894.07MB 10.63%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.Layout.String /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/geom.go
         0     0% 91.84%  9889.58MB  1.85%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.length1 /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/flat_length.go
         0     0% 91.84%  8408.54MB  1.57%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson.unmarshalCoords3
         0     0% 91.84% 10682.04MB  2.00%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson.unmarshalCoords3 /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson/geojson.go
         0     0% 91.84% 10640.80MB  1.99%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb.Read /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/point.go
         0     0% 91.84%  4257.02MB   0.8%  github.com/golang/protobuf/proto.(*Buffer).enc_map_body /home/travis/gopath/src/github.com/golang/protobuf/proto/encode.go
         0     0% 91.84%  4260.02MB   0.8%  github.com/golang/protobuf/proto.(*Buffer).enc_slice_int32 /home/travis/gopath/src/github.com/golang/protobuf/proto/encode.go
         0     0% 91.84%  4762.62MB  0.89%  net.cgoLookupCNAME /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/cgo_unix.go
         0     0% 91.84%  4784.78MB  0.89%  net.cgoLookupServicePort /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/cgo_unix.go
         0     0% 91.84%  4762.62MB  0.89%  net.dialParallel.func1 /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/dial.go
         0     0% 91.84%  4763.62MB  0.89%  net.printStruct.func1 /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/dnsmsg.go
         0     0% 91.84%  4154.79MB  0.78%  net/http.(*Transport).dialConn /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/client.go
         0     0% 91.84% 19908.12MB  3.72%  net/http.(*Transport).getConn /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/transport.go
         0     0% 91.84%  5340.65MB     1%  net/http.(*Transport).putOrCloseIdleConn /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/transport.go
         0     0% 91.84%  6259.21MB  1.17%  net/http.(*Transport).tryPutIdleConn /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/transport.go
         0     0% 91.84%  6259.21MB  1.17%  net/http.(*badStringError).Error /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/request.go
         0     0% 91.84%  4659.46MB  0.87%  net/http.(*conn).serve /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/server.go
         0     0% 91.84%  5858.86MB  1.09%  net/http.(*http2priorityWriteScheduler).OpenStream /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/h2_bundle.go
         0     0% 91.84%  8942.30MB  1.67%  net/http.(*maxBytesReader).Read /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/request.go
         0     0% 91.84%  5335.84MB     1%  net/http.(*response).Flush /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/server.go
         0     0% 91.84%  6247.71MB  1.17%  net/http.(*transferWriter).WriteBody /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/transfer.go
         0     0% 91.84% 73191.75MB 13.67%  net/http.htmlSig.match /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/sniff.go
         0     0% 91.84% 17751.29MB  3.32%  net/http.parseBasicAuth /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/request.go
         0     0% 91.84%  4680.01MB  0.87%  text/template.(*state).errorf /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/text/template/exec.go
         0     0% 91.84%  4257.52MB   0.8%  text/template.(*state).varValue /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/text/template/exec.go
         0     0% 91.84%  4679.51MB  0.87%  vendor/golang_org/x/crypto/chacha20poly1305.chacha20Poly1305Open /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s

go tool pprof --inuse_space --text http://localhost:8080/debug/pprof/heap >heap-inuse.log
heap-inuse.log

File: dgraph
Build ID: 10ae31734c629ed7885fa2a2831cf2fe8c11bf04
Type: inuse_space
Time: Sep 28, 2018 at 11:23am (CST)
Showing nodes accounting for 4081.67MB, 98.37% of 4149.19MB total
Dropped 67 nodes (cum <= 20.75MB)
      flat  flat%   sum%        cum   cum%
 1067.13MB 25.72% 25.72%  1067.13MB 25.72%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson.ErrDimensionalityTooLow.Error /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson/geojson.go
  424.09MB 10.22% 35.94%  2132.46MB 51.39%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson.(*Geometry).Decode /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson/geojson.go
  423.61MB 10.21% 46.15%  3691.69MB 88.97%  github.com/dgraph-io/dgraph/tok.init /home/travis/gopath/src/github.com/dgraph-io/dgraph/tok/stopwords.go
  393.54MB  9.48% 55.63%   485.55MB 11.70%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb.Write /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb/wkb.go
  354.99MB  8.56% 64.19%   354.99MB  8.56%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/geojson.(*Geometry).Decode /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/polygon.go
  284.76MB  6.86% 71.05%   284.76MB  6.86%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb.Read /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/multilinestring.go
  249.61MB  6.02% 77.07%   249.61MB  6.02%  net/http.(*http2ClientConn).forgetStreamID /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/h2_bundle.go
   95.19MB  2.29% 79.36%    95.19MB  2.29%  net/http.(*transferWriter).probeRequestBody /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/transfer.go
   80.50MB  1.94% 81.30%    80.50MB  1.94%  crypto/sha1.(*digest).constSum /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/crypto/sha1/sha1.go
   73.50MB  1.77% 83.07%    73.50MB  1.77%  github.com/prometheus/client_golang/prometheus.(*constSummary).Write /home/travis/gopath/src/github.com/prometheus/client_golang/prometheus/summary.go
   65.51MB  1.58% 84.65%    77.01MB  1.86%  github.com/dgraph-io/dgraph/bp128.dunpack256_62 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
   63.51MB  1.53% 86.18%   105.01MB  2.53%  github.com/dgraph-io/dgraph/bp128.dunpack256_57 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
   62.75MB  1.51% 87.70%    62.75MB  1.51%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkbcommon.(*ErrUnknownType).Error <autogenerated>
   59.50MB  1.43% 89.13%    59.50MB  1.43%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkbcommon.(*ErrUnexpectedType).Error <autogenerated>
   55.50MB  1.34% 90.47%   100.51MB  2.42%  plugin.open /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/plugin/plugin_dlopen.go
   54.52MB  1.31% 91.78%    54.52MB  1.31%  runtime.malg /usr/local/go/src/runtime/proc.go
      54MB  1.30% 93.08%   842.31MB 20.30%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkbcommon.ReadFlatCoords2 /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkbcommon/wkbcommon.go
      53MB  1.28% 94.36%       53MB  1.28%  github.com/dgraph-io/dgraph/bp128.dunpack256_36 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
   41.50MB  1.00% 95.36%    41.50MB  1.00%  github.com/dgraph-io/dgraph/bp128.dunpack256_14 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
   41.50MB  1.00% 96.36%    41.50MB  1.00%  github.com/dgraph-io/dgraph/bp128.dunpack256_56 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
   39.50MB  0.95% 97.31%    39.50MB  0.95%  github.com/dgraph-io/dgraph/vendor/github.com/blevesearch/blevex/stemmer.NewStemmerFilter /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/blevesearch/blevex/stemmer/stemmer_filter.go
   38.45MB  0.93% 98.24%    38.45MB  0.93%  runtime.mapdelete_fast32 /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/runtime/hashmap_fast.go
       5MB  0.12% 98.36%    44.50MB  1.07%  plugin.pathToPrefix /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/plugin/plugin_dlopen.go
    0.50MB 0.012% 98.37%    57.56MB  1.39%  runtime.systemstack /usr/local/go/src/runtime/asm_amd64.s
         0     0% 98.37%   146.51MB  3.53%  github.com/dgraph-io/dgraph/bp128.dunpack256_58 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
         0     0% 98.37%   146.51MB  3.53%  github.com/dgraph-io/dgraph/bp128.dunpack256_59 /home/travis/gopath/src/github.com/dgraph-io/dgraph/bp128/unpack_amd64.s
         0     0% 98.37%    83.20MB  2.01%  github.com/dgraph-io/dgraph/vendor/github.com/coreos/etcd/raft.stepLeader /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/coreos/etcd/raft/raft.go
         0     0% 98.37%    83.20MB  2.01%  github.com/dgraph-io/dgraph/vendor/github.com/coreos/etcd/raft/raftpb.(*Entry).Unmarshal /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/coreos/etcd/raft/raftpb/raft.pb.go
         0     0% 98.37%    83.20MB  2.01%  github.com/dgraph-io/dgraph/vendor/github.com/coreos/etcd/raft/raftpb.(*SnapshotMetadata).Unmarshal /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/coreos/etcd/raft/raftpb/raft.pb.go
         0     0% 98.37%    83.20MB  2.01%  github.com/dgraph-io/dgraph/vendor/github.com/gogo/protobuf/proto.(*Properties).Parse /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/gogo/protobuf/proto/properties.go
         0     0% 98.37%    83.20MB  2.01%  github.com/dgraph-io/dgraph/vendor/github.com/gogo/protobuf/proto.logNoSliceEnc /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/gogo/protobuf/proto/properties.go
         0     0% 98.37%   648.22MB 15.62%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.(*MultiLineString).Swap /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/multilinestring.go
         0     0% 98.37%   648.22MB 15.62%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.(*MultiPoint).Swap /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/flat_geom1.go
         0     0% 98.37%  1847.51MB 44.53%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.(*MultiPolygon).Clone /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/multipolygon.go
         0     0% 98.37%   100.01MB  2.41%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.(*geom1).Coord /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/flat_geom1.go
         0     0% 98.37%  1808.95MB 43.60%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.Coord.Equal /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/geom.go
         0     0% 98.37%  1454.68MB 35.06%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.Layout.String /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/geom.go
         0     0% 98.37%    39.50MB  0.95%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom.deflate3 /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/flat_deflate.go
         0     0% 98.37%    92.01MB  2.22%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb.Read /home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkb/wkb.go
         0     0% 98.37%    80.50MB  1.94%  github.com/dgraph-io/dgraph/vendor/github.com/twpayne/go-geom/encoding/wkbcommon.(*ErrUnknownByteOrder).Error <autogenerated>
         0     0% 98.37%    83.20MB  2.01%  github.com/prometheus/client_golang/prometheus.sanitizeCode /home/travis/gopath/src/github.com/prometheus/client_golang/prometheus/http.go
         0     0% 98.37%    83.20MB  2.01%  github.com/prometheus/client_golang/prometheus.sanitizeMethod /home/travis/gopath/src/github.com/prometheus/client_golang/prometheus/http.go
         0     0% 98.37%    38.45MB  0.93%  net/http.(*Server).Shutdown /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/server.go
         0     0% 98.37%   133.64MB  3.22%  net/http.(*Transport).RoundTrip /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/transport.go
         0     0% 98.37%   300.05MB  7.23%  net/http.(*Transport).getConn /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/transport.go
         0     0% 98.37%   204.86MB  4.94%  net/http.(*http2priorityWriteScheduler).AdjustStream /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/h2_bundle.go
         0     0% 98.37%   166.41MB  4.01%  net/http.Header.clone /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/header.go
         0     0% 98.37%   423.61MB 10.21%  net/http.htmlSig.match /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/sniff.go
         0     0% 98.37%    83.20MB  2.01%  net/http.http2encodeHeaders /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/h2_bundle.go
         0     0% 98.37%    95.19MB  2.29%  net/http.parseBasicAuth /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/request.go
         0     0% 98.37%    95.19MB  2.29%  net/http.readRequest /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/net/http/request.go
         0     0% 98.37%    39.50MB  0.95%  plugin._Cfunc_pluginOpen plugin/_obj/_cgo_gotypes.go
         0     0% 98.37%    83.20MB  2.01%  runtime.main /usr/local/go/src/runtime/proc.go
         0     0% 98.37%    38.45MB  0.93%  runtime.mapassign_faststr /home/travis/.gimme/versions/go1.9.4.linux.amd64/src/runtime/hashmap_fast.go
         0     0% 98.37%    57.56MB  1.39%  runtime.mstart /usr/local/go/src/runtime/proc.go
         0     0% 98.37%    56.05MB  1.35%  runtime.newproc.func1 /usr/local/go/src/runtime/proc.go
         0     0% 98.37%    56.05MB  1.35%  runtime.newproc1 /usr/local/go/src/runtime/proc.go

the alloc_space
Showing nodes accounting for 491551.67MB, 91.84% of 535253.68MB total
the inuse_space
Showing nodes accounting for 4081.67MB, 98.37% of 4149.19MB total

why it alloc 535253.68MB and just used 4149.19MB .

and


(Gus) #2

What makes you think there’s a leak? The size reported in alloc_space ?


(护群神兽之点赞狂魔) #3

Hi gus, I’m a newbie to go and dgraph.
when I use dgraph, I find the memory cost increased slowly.
I have no new data inserted ,only static data to query.
And sometimes it almost use up all my memory. I need to stop it and restart it, then fine.
I just guess ‘there may be a memory leak’ ,sorry,I can’t prove it. just guess …
Is the size reported in alloc_space reasonable?

Thank you a lot.


(Gus) #4

The Go pprof stuff is not very well documented in the open. The alloc_space samples the total memory usage, all allocations, since program started. The inuse_space tell us the actual memory usage, but this can be a bit misleading in Linux due to aggressive virtual memory (VM) use. So when testing for leaks in Linux, it is best to disable VM.

The best source to read about this is the source itself [npi] - https://golang.org/src/runtime/mprof.go


(护群神兽之点赞狂魔) #5

thanks a lot.
I will check it later


(Guido Stepken) #6

When you don’t release references in Go, you have a memory leak. Go, in that case, is nothing different than C, C++.