Giter Site home page Giter Site logo

Comments (4)

alanxz avatar alanxz commented on July 28, 2024

This is definitely a bug. I can reproduce the effects on my machine with the above code.

I believe the reason behind this is the way rabbitmq-c handles memory. rabbitmq-c allocates all incoming frames in a common memory pool, and it can only recycle this pool once all of the frames that have been allocated have been dealt with. When the QoS is set to be > 1, there is always a backlog of frames, so the memory pool is never allowed to recycle, thus the unbounded memory growth. Its also possible there is a frame on another channel hanging around somewhere, which would have the same effect, though not seeing the behavior when QoS == 1 makes me think its not another frame on a different channel.

This is what alanxz/rabbitmq-c#5 is supposed to solve (for a variety of reasons I don't think I will end up merging that PR). I think in this case however, I don't think even that will help, as this is all happening in one channel.

I think the 'solution' is: internally when reading frames we need to try hard to immediately use all of the frames that rabbitmq-c generates so that the memory pool can be recycled.

from simpleamqpclient.

RafalGoslawski avatar RafalGoslawski commented on July 28, 2024

The problem exists when there is only one channel. If I use seperate channels for consume/ack and publish memory pool is recycled just fine. But that's just a workaround not a solution.

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

Interesting. Given what I think the problem is - I would not have expected separating out publish and consumer to their own Channel objects would've alleviated the memory issue. But I'm glad you found a workaround for the moment.

from simpleamqpclient.

chenyujian avatar chenyujian commented on July 28, 2024

#30

from simpleamqpclient.

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.