Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
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
https://cloud.oprendek.sk/index.php/s/y2on5Wxx5xnc5cG
Changes:
- I removed the links as they are not password-protected
- Meanwhile I added
processed_idx
dict to avoid hashing the files again and again (useslocal_id
instead) 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.
.