Giter Site home page Giter Site logo

Comments (4)

Hchenn avatar Hchenn commented on May 7, 2024

From the flame graph provided, the memory usage mainly comes from two parts:

  1. netpoll(*connection).init:
    1. indicates that a lot of connections are Accepted and maintained, not closed.
    2. If so, the memory performance may be normal.
  2. netpoll(*LinkBuffer).growth:
    1. indicates that the memory is growing. Please confirm whether you have actively called Release to release the memory. for example
    2. If you have done so, the memory performance may be normal.

from netpoll.

da-tai avatar da-tai commented on May 7, 2024

My code looks like this

var eventLoop netpoll.EventLoop

func handler(ctx context.Context, conn netpoll.Connection) error {

    data, err := conn.Reader().ReadBinary(conn.Reader().Len())
        if err != nil {
		logging...
		return conn.Close()
	}
    ....business logic......
     conn.Reader().Release()
     remote := net.Dial(remote server)
     go func () {
         _, err := io.Copy(remote,conn)
      }
      io.Copy(conn,remote)
}

What I am noticing is on a specific VPS provider, I get the memory issue but on another, i don't.
Here is the flame graph of another.

profile002

from netpoll.

Hchenn avatar Hchenn commented on May 7, 2024

PS: The first graph is abbreviated as Fig 1, the second as Fig 2

I found that in the two graphs, the difference lies in the proportion of netpoll(*LinkBuffer).growth
The handleTCPProxy in Fig 2 is inlined but not in Fig 1. Is there a difference here ?

Sorry for not finding other useful help.

from netpoll.

da-tai avatar da-tai commented on May 7, 2024

This is helpful thanks. I will reopen this issue if I find something more defined.

Thanks again.

from netpoll.

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.