$ go tool pprof --alloc_space http://localhost:6060/debug/pprof/heap Read http://localhost:6060/debug/pprof/symbol Fetching /pprof/heap profile from localhost:6060 to /tmp/V1VPMoi_qL Wrote profile to /tmp/V1VPMoi_qL Adjusting heap profiles for 1-in-524288 sampling rate Welcome to pprof! For help, type 'help'. (pprof) top25 Total: 2774115.3 MB 825914.5 29.8% 29.8% 826964.0 29.8% github.com/couchbase/query/parser/n1ql.funcĀ·003 790553.0 28.5% 58.3% 844779.0 30.5% github.com/couchbase/query/parser/n1ql.yyParse 491846.0 17.7% 76.0% 491846.0 17.7% github.com/couchbase/query/execution.newBase 377708.0 13.6% 89.6% 404886.0 14.6% github.com/couchbase/query/parser/n1ql.NewLexerWithInit 52013.0 1.9% 91.5% 52013.0 1.9% github.com/couchbase/query/parser/n1ql.(*Lexer).next 33989.0 1.2% 92.7% 33989.0 1.2% bufio.NewReaderSize 12261.5 0.4% 93.2% 14560.5 0.5% github.com/couchbase/query/algebra.subqueryPrivileges 8764.0 0.3% 93.5% 8764.0 0.3% net/textproto.MIMEHeader.Set 8022.5 0.3% 93.8% 9872.0 0.4% github.com/couchbase/query/server.NewBaseRequest 6808.5 0.2% 94.0% 6808.5 0.2% bufio.NewWriter 6304.0 0.2% 94.2% 6472.5 0.2% net/textproto.(*Reader).ReadMIMEHeader 6202.0 0.2% 94.5% 6420.0 0.2% github.com/couchbase/query/algebra.(*KeyspaceTerm).Privileges 6000.5 0.2% 94.7% 19814.0 0.7% github.com/couchbase/query/algebra.(*Subselect).Privileges 5793.0 0.2% 94.9% 13303.0 0.5% encoding/json.Marshal 5244.0 0.2% 95.1% 169064.0 6.1% github.com/couchbase/query/execution.NewSequence 4949.0 0.2% 95.3% 5144.5 0.2% encoding/json.(*Decoder).readValue 4528.5 0.2% 95.4% 4528.5 0.2% runtime.convT2E 4314.0 0.2% 95.6% 4321.0 0.2% github.com/couchbase/query/server/http.(*bufferedWriter).writeString 4111.5 0.1% 95.7% 4111.5 0.1% io/ioutil.readAll 4083.5 0.1% 95.9% 45580.1 1.6% github.com/couchbase/query/server/http.newHttpRequest 3776.5 0.1% 96.0% 3776.5 0.1% github.com/couchbase/query/value.objectValue.SetField 3549.5 0.1% 96.1% 4895.0 0.2% github.com/couchbase/query/planner.(*builder).VisitSubselect 3430.5 0.1% 96.3% 4919.0 0.2% net/http.NewRequest 3320.0 0.1% 96.4% 18884.1 0.7% net/http.(*Transport).dialConn 3120.5 0.1% 96.5% 12785.0 0.5% github.com/couchbase/query/server/http.(*httpRequest).writeError