Prevent iOS from killing Pythonista
I have a script that should index whole Camera Roll (11k pictures) - it iterates the pictures and computes a hash of each. After around 1300 pictures, iOS kills Pythonista. How to prevent that?
@MichalOprendek perhaps you don'T free used memory after each processed photo. If not too long, could you posT your code?
Hi, it is here
- I removed the links as they are not password-protected
- Meanwhile I added
processed_idxdict to avoid hashing the files again and again (uses
local_idinstead) to overcome the problem...
Now uploading fails after some time but thanks to the latter it is easily restartable.
@MichalOprendek perhaps del data when no more needed in the loop
When processing camera roll, it is important to use an autorelease pool, and also you need to clear cached methods in the objects, due to a pythonista bug that creates reference cycles and prevents gc from running.