Code Monkey home page Code Monkey logo

Comments (4)

crossci avatar crossci commented on May 18, 2024
heap profile: 82: 9868976 [40409: 40811376] @ heap/1048576
1: 3719168 [1: 3719168] @ 0x8509e8 0x8516bc 0x460391
#	0x8509e7	github.com/davyxu/cellnet.(*Pipe).Pick+0x1a7			/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/pipe.go:48
#	0x8516bb	github.com/davyxu/cellnet.(*eventQueue).StartLoop.func1+0x7b	/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/queue.go:87

1: 3719168 [1: 3719168] @ 0x8507c6 0x850b89 0x850f60 0x850f00 0x85b9ba 0x859306 0x922fb4 0x460391
#	0x8507c5	github.com/davyxu/cellnet.(*Pipe).Add+0xf5				/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/pipe.go:17
#	0x850b88	github.com/davyxu/cellnet.(*eventQueue).Post+0x48			/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/queue.go:57
#	0x850f5f	github.com/davyxu/cellnet.QueuedCall+0x3f				/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/queue.go:155
#	0x850eff	github.com/davyxu/cellnet.SessionQueuedCall+0x7f			/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/queue.go:147
#	0x85b9b9	github.com/davyxu/cellnet/proc.NewQueuedEventCallback.func1+0xc9	/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/proc/procbundle.go:25
#	0x859305	github.com/davyxu/cellnet/peer.(*CoreProcBundle).ProcEvent+0x65		/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/peer/procbundle.go:66
#	0x922fb3	github.com/davyxu/cellnet/peer/tcp.(*tcpSession).recvLoop+0x93		/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/peer/tcp/session.go:151

1: 1212416 [1: 1212416] @ 0x8507c6 0x922dd1 0x85c3c6 0x934b46 0x936279 0x936246 0x85b8d7 0x850f74 0x850f00 0x85b9ba 0x859306 0x91c794 0x460391
#	0x8507c5	github.com/davyxu/cellnet.(*Pipe).Add+0xf5				/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/pipe.go:17
#	0x922dd0	github.com/davyxu/cellnet/peer/tcp.(*tcpSession).Send+0x60		/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/peer/tcp/session.go:91
#	0x85c3c5	GATE/src/game.(*Game).Send+0xc5						/app/src/game/game.go:56
#	0x934b45	GATE/src/server.(*ServerManager).onClientPacket+0x505			/app/src/server/servermanager.go:129
#	0x936278	GATE/src/server.(*Server).onClientPacket+0x98				/app/src/server/server.go:40
#	0x936245	GATE/src/server.(*Server).Init.func1+0x65				/app/src/server/server.go:28
#	0x85b8d6	github.com/davyxu/cellnet/proc.NewQueuedEventCallback.func1.1+0x36	/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/proc/procbundle.go:27
#	0x850f73	github.com/davyxu/cellnet.QueuedCall+0x53				/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/queue.go:153
#	0x850eff	github.com/davyxu/cellnet.SessionQueuedCall+0x7f			/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/queue.go:147
#	0x85b9b9	github.com/davyxu/cellnet/proc.NewQueuedEventCallback.func1+0xc9	/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/proc/procbundle.go:25
#	0x859305	github.com/davyxu/cellnet/peer.(*CoreProcBundle).ProcEvent+0x65		/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/peer/procbundle.go:66
#	0x91c793	GATE/src/mytcp.(*tcpSession).recvLoop+0x93				/app/src/mytcp/session.go:152

1: 1212416 [1: 1212416] @ 0x8509e8 0x92342a 0x460391
#	0x8509e7	github.com/davyxu/cellnet.(*Pipe).Pick+0x1a7			/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/pipe.go:48
#	0x923429	github.com/davyxu/cellnet/peer/tcp.(*tcpSession).sendLoop+0x59	/go/pkg/mod/github.com/davyxu/[email protected]+incompatible/peer/tcp/session.go:165

pprof显示这里有很大内存,请大神指点一下 谢谢

from cellnet.

davyxu avatar davyxu commented on May 18, 2024

你放到队列里的东西大, 当然显示内存大了.
writeList[0:0]的意思就是保留元素空间, 重置指针
如果泄露, 那每一个元素都会泄露

from cellnet.

davyxu avatar davyxu commented on May 18, 2024

已经用过的内存不重用, 有新数据就新申请内存?. 你是有多少钱买内存啊

from cellnet.

davyxu avatar davyxu commented on May 18, 2024

买本go的书看下吧, issue只提bug, 不教学

from cellnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.