hipbyte / rubymotiondocumentation Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://www.rubymotion.com/developer-center
Home Page: http://www.rubymotion.com/developer-center
It would be great to have an in depth article on managing memory with RubyMotion. I don't know exactly what to ask for in the article because I don't know what I don't know.
One issue is that I discovered is that I wasn't using Xcode's instruments correctly. I was tracking the "simulator" process instead of my own app within the simulator. After that discovery, it makes instruments much more useful.
Another issue would be how to effectively use "autorelease_pool". I've found it doesn't hurt to put it in multiple places in the code, especially as the first thing inside loops. Another significant thing seems to be that it can be nested in the code. At first when I started using it, I was afraid to nest it but it seems to work fine that way. It doesn't solve all the memory release problems and I'm unsure of exactly what is happening when it doesn't work.
In past correspondence you've said "it is better to avoid creating too many objects in a single method". Maybe a little more into exactly what is happening in that case or how many is too many. If it is a lot, does it help to wrap sections of them in autorelease_pool? What exactly is the situation when RubyMotion isn't able to free up memory that isn't used anymore?
...and you said "I should try to defer that asynchronously (using the Dispatch module)"
I've had mixed success with that. I've broken up a long tasks into blocks that are put in an async queue but memory still doesn't seem to be freed up after each block finishes. Adding "autorelease_pool" around pieces of those blocks does help but why doesn't the memory allocated in those blocks already get freed when the queue block finishes? From using "instruments" it seems that the heap memory is getting freed after each queue block finishes but the overall memory still creeps higher and higher as more blocks are processed.
I suggest to use gollum for the following reasons:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.