stefanceriu / SCPageViewController

Just like UIPageViewController but better.. :)
MIT License
352 stars 70 forks source link

Memory Usage shoots up #23

Closed sudeepunnikrishnan closed 8 years ago

sudeepunnikrishnan commented 8 years ago

Hi Stefan

On using SCPageViewController to show about 50 pages ,the memory shoots up to more than 100MB.Tried setting the viewcontrollers to null once shown, but it does not make any changes.

Expecting some solution for this. Thanks in advance.

stefanceriu commented 8 years ago

Hey,

We've been using this in production for a couple of year now and we haven't seen any memory issues.

If you are just working on top of the code from the demo app you should pay attention to the fact that the dataSource property acts like a cache but never releases any of the view controllers.

You could listen to the UIApplicationDidReceiveMemoryWarningNotification and replace these view controllers with NSNulls or build the view controllers on the fly and remove the dataSource property all together.

Now, if I'm not right and you indeed found a problem in the component itself please provide me with more details, code or a simple project I can use to reproduce it.

sudeepunnikrishnan commented 8 years ago

Hi Stefan

Made changes by building the viecontrollers on the fly,now it seems to be fine.While replacing the view controllers with NSNulls ,it did not make much reduction in memory usage.Well for the time,issue seems to be resolved.

Thanks!

stefanceriu commented 8 years ago

:+1: