I am seeing a memory leaks in sync_gateway (1.0.4)
I am not a Go programmer but I was hoping to gather some data that would be
useful in finding these leaks.
I turned on profiling and took heap data snapshots about 12 hours apart. I
hope I did this correctly.
Is this data useful in finding the leaks? Is there anything else I could
do to help?
Snapshot 1 pprof...
Entering interactive mode (type "help" for commands)
(pprof) top
170.47MB of 173.04MB total (98.52%)
Dropped 253 nodes (cum <= 0.87MB)
Showing top 10 nodes out of 39 (cum >= 1MB)
flat flat% sum% cum cum%
68.63MB 39.66% 39.66% 70.63MB 40.82% strconv.fmtF
64.63MB 37.35% 77.01% 64.63MB 37.35%
github.com/couchbase/sync_gateway/rest.(*handler).handlePersonaPOST
12.69MB 7.34% 84.35% 18.20MB 10.52% goexit0
10.50MB 6.07% 90.42% 10.50MB 6.07% badfutexwakeup
3.50MB 2.02% 92.44% 21.70MB 12.54%
github.com/couchbase/sync_gateway/base.ParseLogFlags
3.01MB 1.74% 94.18% 3.01MB 1.74% strconv.fmtE
2.80MB 1.62% 95.80% 2.80MB 1.62% net/http.initNPNRequest.ServeHTTP
2.71MB 1.56% 97.36% 2.71MB 1.56% github.com/gorilla/mux.(*Route).URLHost
1MB 0.58% 97.94% 1MB 0.58% github.com/couchbaselabs/walrus.(*lolrus).GetRaw
1MB 0.58% 98.52% 1MB 0.58% fmt.(*ss).scanOne
Snapshot 2 pprof
(pprof) top
394.93MB of 428.50MB total (92.16%)
Dropped 239 nodes (cum <= 2.14MB)
Showing top 10 nodes out of 54 (cum >= 6.50MB)
flat flat% sum% cum cum%
69.63MB 16.25% 16.25% 84.64MB 19.75% strconv.fmtF
68.67MB 16.03% 32.28% 68.67MB 16.03% net/http.initNPNRequest.ServeHTTP
64.63MB 15.08% 47.36% 64.63MB 15.08%
github.com/couchbase/sync_gateway/rest.(*handler).handlePersonaPOST
45.20MB 10.55% 57.91% 164.58MB 38.41% goexit0
39.70MB 9.27% 67.17% 39.70MB 9.27% github.com/gorilla/mux.(*Route).URLHost
37.01MB 8.64% 75.81% 201.59MB 47.04%
github.com/couchbase/sync_gateway/base.ParseLogFlags
35.56MB 8.30% 84.11% 35.56MB 8.30% badfutexwakeup
19.50MB 4.55% 88.66% 19.50MB 4.55% type..eq.runtime.mspan
8.52MB 1.99% 90.65% 8.52MB 1.99%
github.com/couchbase/sync_gateway/rest.(*handler).userAgentIs
6.50MB 1.52% 92.16% 6.50MB 1.52%
github.com/couchbaselabs/walrus.(*lolrus).GetRaw
(pprof) list net/http.initNPNRequest.ServeHTTP
Total: 428.50MB
ROUTINE ======================== net/http.initNPNRequest.ServeHTTP in
/usr/local/go/src/net/http/server.go
68.67MB 68.67MB (flat, cum) 16.03% of Total
. . 2024: h serverHandler
. . 2025:}
. . 2026:
. . 2027:func (h initNPNRequest) ServeHTTP(rw ResponseWriter, req *Request)
{
. . 2028: if req.TLS == nil {
68.67MB 68.67MB 2029: req.TLS = &tls.ConnectionState{}
. . 2030: *req.TLS = h.c.ConnectionState()
. . 2031: }
. . 2032: if req.Body == nil {
. . 2033: req.Body = eofReader
. . 2034: }
(pprof) list goexit0
Total: 428.50MB
ROUTINE ======================== goexit0 in /usr/local/go/src/runtime/proc.c
45.20MB 164.58MB (flat, cum) 38.41% of Total
. . 1688: runtime·mcall(&fn);
. . 1689:}
. . 1690:
. . 1691:// runtime·goexit continuation on g0.
. . 1692:static void
. . 1693:goexit0(G *gp)
. . 1694:{
. 2.50MB 1695: runtime·casgstatus(gp, Grunning, Gdead);
. . 1696: gp->m = nil;
. . 1697: gp->lockedm = nil;
. . 1698: g->m->lockedg = nil;
. . 1699: gp->paniconfault = 0;
. . 1700: gp->defer = nil; // should be true already but just in case.
. . 1701: gp->panic = nil; // non-nil for Goexit during panic. points at
stack-allocated data.
. . 1702: gp->writebuf.array = nil;
45.20MB 162.08MB 1703: gp->writebuf.len = 0;
. . 1704: gp->writebuf.cap = 0;
. . 1705: gp->waitreason.str = nil;
. . 1706: gp->waitreason.len = 0;
. . 1707: gp->param = nil;
. . 1708:
Entering interactive mode (type "help" for commands)
(pprof) top
170.47MB of 173.04MB total (98.52%)
Dropped 253 nodes (cum <= 0.87MB)
Showing top 10 nodes out of 39 (cum >= 1MB)
flat flat% sum% cum cum%
68.63MB 39.66% 39.66% 70.63MB 40.82% strconv.fmtF
64.63MB 37.35% 77.01% 64.63MB 37.35%
github.com/couchbase/sync_gateway/rest.(*handler).handlePersonaPOST
12.69MB 7.34% 84.35% 18.20MB 10.52% goexit0
10.50MB 6.07% 90.42% 10.50MB 6.07% badfutexwakeup
3.50MB 2.02% 92.44% 21.70MB 12.54%
github.com/couchbase/sync_gateway/base.ParseLogFlags
3.01MB 1.74% 94.18% 3.01MB 1.74% strconv.fmtE
2.80MB 1.62% 95.80% 2.80MB 1.62% net/http.initNPNRequest.ServeHTTP
2.71MB 1.56% 97.36% 2.71MB 1.56% github.com/gorilla/mux.(*Route).URLHost
1MB 0.58% 97.94% 1MB 0.58% github.com/couchbaselabs/walrus.(*lolrus).GetRaw
1MB 0.58% 98.52% 1MB 0.58% fmt.(*ss).scanOne
(pprof) top
394.93MB of 428.50MB total (92.16%)
Dropped 239 nodes (cum <= 2.14MB)
Showing top 10 nodes out of 54 (cum >= 6.50MB)
flat flat% sum% cum cum%
69.63MB 16.25% 16.25% 84.64MB 19.75% strconv.fmtF
68.67MB 16.03% 32.28% 68.67MB 16.03% net/http.initNPNRequest.ServeHTTP
64.63MB 15.08% 47.36% 64.63MB 15.08%
github.com/couchbase/sync_gateway/rest.(*handler).handlePersonaPOST
45.20MB 10.55% 57.91% 164.58MB 38.41% goexit0
39.70MB 9.27% 67.17% 39.70MB 9.27% github.com/gorilla/mux.(*Route).URLHost
37.01MB 8.64% 75.81% 201.59MB 47.04%
github.com/couchbase/sync_gateway/base.ParseLogFlags
35.56MB 8.30% 84.11% 35.56MB 8.30% badfutexwakeup
19.50MB 4.55% 88.66% 19.50MB 4.55% type..eq.runtime.mspan
8.52MB 1.99% 90.65% 8.52MB 1.99%
github.com/couchbase/sync_gateway/rest.(*handler).userAgentIs
6.50MB 1.52% 92.16% 6.50MB 1.52%
github.com/couchbaselabs/walrus.(*lolrus).GetRaw
(pprof) list net/http.initNPNRequest.ServeHTTP
Total: 428.50MB
ROUTINE ======================== net/http.initNPNRequest.ServeHTTP in
/usr/local/go/src/net/http/server.go
68.67MB 68.67MB (flat, cum) 16.03% of Total
. . 2024: h serverHandler
. . 2025:}
. . 2026:
. . 2027:func (h initNPNRequest) ServeHTTP(rw
ResponseWriter, req *Request) {
. . 2028: if req.TLS == nil {
68.67MB 68.67MB 2029: req.TLS = &tls.ConnectionState{}
. . 2030: *req.TLS = h.c.ConnectionState()
. . 2031: }
. . 2032: if req.Body == nil {
. . 2033: req.Body = eofReader
. . 2034: }
(pprof) list goexit0
Total: 428.50MB
ROUTINE ======================== goexit0 in /usr/local/go/src/runtime/proc.c
45.20MB 164.58MB (flat, cum) 38.41% of Total
. . 1688: runtime·mcall(&fn);
. . 1689:}
. . 1690:
. . 1691:// runtime·goexit continuation on g0.
. . 1692:static void
. . 1693:goexit0(G *gp)
. . 1694:{
. 2.50MB 1695: runtime·casgstatus(gp, Grunning, Gdead);
. . 1696: gp->m = nil;
. . 1697: gp->lockedm = nil;
. . 1698: g->m->lockedg = nil;
. . 1699: gp->paniconfault = 0;
. . 1700: gp->defer = nil; // should be true already
but just in case.
. . 1701: gp->panic = nil; // non-nil for Goexit during
panic. points at stack-allocated data.
. . 1702: gp->writebuf.array = nil;
45.20MB 162.08MB 1703: gp->writebuf.len = 0;
. . 1704: gp->writebuf.cap = 0;
. . 1705: gp->waitreason.str = nil;
. . 1706: gp->waitreason.len = 0;
. . 1707: gp->param = nil;
. . 1708:
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/34cd2982-9d26-47c2-8ffd-85faa39acd7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.