1

I guess this is basically the RubyMotion analogue of this question.

What are some strategies and resources to doing large imports of data into Core Data via the Network? Has anyone done this in RubyMotion yet?

1 Answer 1

1

I'm going through the same problem and have not found a satisfactory solution yet. So far, I've created an async dispatch queue to divide up the import file from the documents directory into chunks, and then I submit those chunks to another queue. After making sure Core Data likes the contexts that I'm using, that import method runs in the background just fine. The problem is something within the RubyMotion/CoreData system is using memory and not giving it up even when each of the queue'd chunks finishes. So by the time I've processed for a few minutes, the memory usage has ballooned up and I start getting memory warnings. Wrapping all the iterative areas of the code with

autorelease_pool do
...
end

helps a lot but is not enough. And those autorelease_pool blocks can be nested.

1
  • 1
    Did you ever get to the bottom of CoreData not giving up the memory? I'm seeing the same thing! Jan 19, 2015 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.