You must Login before you can answer or comment on any questions.
hi, it tried some garbage collector workaround and i tried reading memory with
Ti.Plaform.availableMemory that results in
Cannot read property "availableMemory" from undefined. now i am a little bit disappointed. there will be no solution for the memory consumption in near future?
i have no idea how to solve the
vm budget exeed-problem.
Without seeing your code, I can't offer any specific comments. I'll make the general (and probably unwelcome) comment that you probably need to refactor your code.
- Create a modular design with content factories imported using commonJS
require(). See http://wiki.appcelerator.org/display/guides/Building+Reusable+Factories for more info
- You can force garbage collection on objects by setting them to
- Optimize images and make sure to remove unneeded images from memory (set their proxy objects to null). Remember that JPG images are decompressed in memory so that "small" file could still have an enormous memory footprint.
- Don't use webviews unless you need their specific functionality. They are one of the most "expensive" components. Don't nest webviews inside tableviews for example.
- Don't instantiate objects till you need them. This defers, though doesn't eliminate memory requirements
- Don't store blob objects in your database then select * from table unless you really need those blobs. Better is to store blobs on the file system and file paths in the db.
Regardless of device memory, your mobile app is allocated only 24 MB of memory.
Is the question here why you cannot get the availableMemory value?
First, in the message you called it Ti.Plaform.availableMemory, where the letter t is missing from Platform. If this was a cut and paste from your source, that would end up making it undefined.
If that was just a typo in the question and the source was fine, then try forcing a full rebuild by cleaning the project. If this was the first time you reference the Platform class, it may not have picked up on the need to include the Platform class module.
i have a very modular design using a factory pattern. that is very nice for working. in general i build 6 window at startup since creating them on click feels very slow on android. bad idea, tim?
Using DDMS i found that Memory allocated to application is get increases as i am navigating screen by screen and after some time it crash application with force close message/Fail to load resources. Even i have remove all objects from window and after that assign null to it. i.e window.remove(viewname); viewname=null; window.close(); window=null. Please help Me OUT.
Think you can help? Login to answer this question!