29 Mar 2012 3:09 AM #1
store garbage collection
When is the garbage collection of store done?
In my app I have a store bound to a list. Whenever I get updated data I recreate the store and bind it to list.
I see that every time I recreate store it increases the utilized app memory by ~6MB.
I tried reusing the same store by retrieving the store from store manager and calling store.removeAll and store.setData. I observed that whenever I use setData the memory increased by ~6MB. I have attached sample apps. I have used both the scenarios of reusing the store as well as recreating store. In these app too I can see that the memory consumed by apps increases by ~2MB (since data is not as huge as we get in our app) whenever I navigate.
Kindly let me know how can I resolve this issue.
Also I have observed that whenever I refresh the app memory consumption increases.
I have removed the sencha libraries from the sample app coz of size restrictions. Kindly copy them to make apps run.
29 Mar 2012 5:51 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
Are the stores put into the StoreManager via the storeId?Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
29 Mar 2012 8:14 PM #3
Yes. I have attached apps having both the scenarios. One app doesnt have storeId for store and I am always recreating the store. Whereas the other app has storeId for the store and I am reusing the same store by retrieving it from store manager and using store.removeAll and store.setData
30 Mar 2012 9:31 AM #4
Thanks for the test cases. Ensuring minimal memory consumption is high on our list of things to look at for 2.1. Your samples will help us greatly. I'm moving this thread to our bug forum, so that I can open a ticket for it in our internal system. This will allow us to provide better feedback to you on our progress with this.
30 Mar 2012 9:32 AM #5
30 Mar 2012 9:35 AM #6
Thanks for the reply. I hope we will get a resolution soon if it is a bug ,as we had our product release lined up and with this issue we cannot release our product. Thanks again for your reply.
30 Mar 2012 9:39 AM #7
No problem. Sorry we don't have a workaround for you at this point. We are working on some other stuff for the upcoming 2.0.1 release, but I'll make sure we have a look somewhere in the middle of next week to see if we can provide a patch for you.
I'm curious though, does this problem become so bad for you that the app crashes, and is this thus the reason you cannot release your product?
30 Mar 2012 10:09 AM #8
Yes... Coz we have pretty complex and huge data coming from server. Also the stores are created at various places due to different data interactions. Our app is pretty complex in terms of the data that it is handling. We can run the app for around 25-30 min without crash on android but on iPhone it is too sensitive and is getting crashed within 5-6 min. When I started debugging the app for memory issues then I found that majority of memory consumption is happening at the places where we are creating/reusing the store. Some times I see the memory consumed is going beyond 100MB only after few minutes.
I observed that only one single store when recreated/reused is increasing memory consumption by around -6MB. And the combined effect is causing the app to crash.
2 Apr 2012 7:58 AM #9
Sounds like the old store's are somehow not being destroyed properly. Again, I'll take a look into this and expect to get back to you somewhere this week.
4 Apr 2012 4:52 AM #10
3 questions on this
1. We have observed (through the developer tools on Chrome and Safari) that in our application, as soon as we create a store with data, the memory usage goes up by 6 MB. The data is in JSON format and size of that string itself is around 33 KB. Isn't this kind of consumption too high for the size of the data? Or is there something different we can do? We are using Memory proxy.
I am worried that in our next phases of development, we would need more data to be loaded. Wondering how we handle additional data if with this itself the app is crashing due to memory issues.
2. Is there a work around for this right now? Eg. Use a different type of proxy? Would that help at all?
3. Do you have any timeline for a resolution to this bug? Week? Couple of weeks? Month?
Just would like to reiterate that we are handicapped right now because of this. The app stays much longer on Android devices but crashes pretty fast on iOS devices (stays not more than a minute or two).
Thanks & Regards