Giter Site home page Giter Site logo

Comments (4)

liruipeng avatar liruipeng commented on June 7, 2024

Hi @thartland If you only call HYPRE_ParVectorDestroy to free the object of IJVecotr, it is expected to have memory leak from the other parts of IJVector. HYPRE_IJVectorDestroy free them as well. I don't see the reason why you can't call HYPRE_IJVectorDestroy on IJ_grad. Maybe I missed something. If you have to call HYPRE_ParVectorDestroy to free the parvector, the way I guess is to manipulate the IJ structure, after HYPRE_IJVectorGetObject, by setting

hypre_IJVectorObject(vector) = NULL

or something like that, so you can call HYPRE_IJVectorDestroy to free the IJVector but keep the ParVector.

from hypre.

rfalgout avatar rfalgout commented on June 7, 2024

We have reference counters in some of the matrix/vector objects in hypre. I wonder if we should expose this to users somehow so they can create persistent references to objects and better manage memory. The simplest thing we could do for now is implement a GetObjectRef call for all matrices and vectors. This would maintain backward compatibility and I think it would help Tucker out. Basically, this call (instead of GetObject) would return an object that must be freed separately at some point. So here both the IJDestroy and the ParDestroy would have to be called (in any order).

from hypre.

thartland avatar thartland commented on June 7, 2024

Thanks everyone for the quick responses! I am glad to know that it wasn't something obvious that I missed. Before your team invests the time into this effort let me communicate a bit more with my team to further clarify needs, I'll follow up in the next few days.

from hypre.

thartland avatar thartland commented on June 7, 2024

I did a slight redesign of my code to avoid memory leaks. Thank you for clarifying how these objects work, that information was useful to me.

from hypre.

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.