Git Product home page Git Product logo

Comments (4)

johnpharmetika avatar johnpharmetika commented on June 2, 2024 1

Thank you for the response,

I believe you are correct with describing allocation being held on BSD vs Linux. Apologies for the non-issue.

from fasthttp.

erikdubbelboer avatar erikdubbelboer commented on June 2, 2024

I'm not sure how to help with this. There is no BSD specific code in fasthttp so I don't see how it could be causing this.

To me the FreeBSD memory profile looks more correct as it actually contains allocations you would expect. It seems like the Linux memory profile contains almost nothing which is unlikely. Try setting runtime.MemProfileRate = 1 at the top of your main func and re-run the memory profiles to get more accurate results.

Fasthttp will always keep some buffers allocated to re-use for next requests. You can see these in the FreeBSD profile but not in the Linux profile. Are you sure the Linux profile was made after it handled some requests?

Have you tried running the FreeBSD version for a while and see if the memory usage keeps increasing or if it stabilizes after a bit?

from fasthttp.

johnpharmetika avatar johnpharmetika commented on June 2, 2024

Thank you for your response,

Apologies for the previous Linux dump, this one with the MemProfileRate set is showing the Fasthttp buffers allocating as expected.

image

Versus FreeBSD, where the same test was done (same requests with the same body size amongst all of them)

image

image

It is also important to note that we use GoFiber (which uses fasthttp) for other endpoints, that do NOT have this issue when ran.

EDIT: On BSD, 45 minutes after all requests finished
Selection_045
Selection_046

from fasthttp.

erikdubbelboer avatar erikdubbelboer commented on June 2, 2024

It looks normal to me. I see buffers being allocated and kept. Why do you think there is a memory leak? What happens when you keep sending requests for a long time, does it run out of memory?

Your top screenshots show that Go has a lot of memory allocated. But that doesn't mean it's actually in use. If there is no memory pressure Go won't release memory to your system even if it isn't using any. How this behaves is differently between Linux and BSD I think.

from fasthttp.

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.