sxross / MotionModel

Simple Model and Validation Mixins for RubyMotion
MIT License
192 stars 67 forks source link

MotionModel and memory #144

Closed holgersindbaek closed 8 years ago

holgersindbaek commented 8 years ago

I'm using motion model to structure and save data I get from my Firebase database. I never persist the data, since it needs to be up to date with the Firebase version of the data.

Will I run into memory issues at some point? Do MotionModel automatically remove data at some point when to many MotionModel have been made? Or should I delete MotionModel data when users refreshes items from the feed?

sxross commented 8 years ago

I tried this and it worked ok but Firebase kind of walked out on me when they were acquired so I haven’t looked recently. Here’s the deal with memory. If you make sure not to leave a chain of global or instance objects that persist for a long duration, then you are fine. So it is important your MotionModel objects go out of scope periodically so the GC can tidy them up. That said, any other store technology will have a similar (but slightly different) set of issues.

My advice: Run a test case under instruments and see if it becomes a problem.

--  Steve Ross Sent with Airmail

On April 15, 2016 at 12:06:14 PM, holgersindbaek (notifications@github.com) wrote:

I'm using motion model to structure and save data I get from my Firebase database. I never persist the data, since it needs to be up to date with the Firebase version of the data.

Will I run into memory issues at some point? Do MotionModel automatically remove data at some point when to many MotionModel have been made? Or should I delete MotionModel data when users refreshes items from the feed?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

holgersindbaek commented 8 years ago

Ok... I'll start by wiping old data every time user enters the app. That should be a good start.