Giter VIP home page Giter VIP logo

Comments (6)

konmik avatar konmik commented on August 21, 2024

Hello,

When a view gets destroyed combineLatest receives null instead of view so it should not keep a reference to the view anymore.

Could you please give me the piece of code that reproduces the issue? I'll try to check it with LeakCanary as well.

from nucleus.

konmik avatar konmik commented on August 21, 2024

The downside of not using restartables is that when you device is low on memory (or your device is Samsung with shitty memory settings) you can lose your background tasks while your app is in the background.

In my opinion, if you're not going to use restartables then there is no reason to use MVP at all. :D

from nucleus.

jmreyes avatar jmreyes commented on August 21, 2024

Hi,

I've uploaded a project that reproduces the problem (it includes a memory dump for MAT showing two instances of MainActivity and two of MainActivityFragment in memory). I've also noticed this only happens when using DeliverFirst, not for DeliverLatestCache or DeliverReplay, and the leak appears for both restartables and non-restartables.

About my question, I was referring to the downside of skipping the call to add() for our Subscriptions. I understand the importance of restartables because of Android killing the process but later restoring the view and so on, even if I acknowledge that's something usually ignored in Android development. The thing is, I am working with a big codebase that I want to refactor into using this approach and my idea was to keep things as simple as possible at first, hence avoiding adding more code to keep request state for now.

Not sure why you mention that there's no reason for MVP in this case, in my opinion it's worth it even if it's only to make background tasks survive configuration changes. Of course that not depends on the MVP pattern itself but on the concrete implementation that takes care of that. That's why I like Nucleus, it's just simple and does the job. But yes, maybe if one is only interested in surviving config changes/process restarts for small projects, using MVP can be overkill. I'll have a look at your Satellite library, looks promising!

from nucleus.

konmik avatar konmik commented on August 21, 2024

Thanks for the project, I'll look into it soon!

About not using restartables. There are no means for View to detect if it is not getting it's data because a request is too long or because the request has been destroyed. This is why restartables matter - they eliminate the "request has been destroyed" reason. Yep, it is up to you to use them. It was the reason for me. :D

from nucleus.

konmik avatar konmik commented on August 21, 2024

ReactiveX/RxJava#3379

from nucleus.

konmik avatar konmik commented on August 21, 2024

Check out 2.0.2.

Thanks for the great report! :)

from nucleus.

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.