I had a memory issue with Django's bulk_update queryset method.
The TLDR version is that bulk_update prepares all the update statements in advance (even when batch_size is set) which can use more memory than expected.
Details and a solution in the blog:


Anže’s Blog
Django bulk_update memory issue
Recently, I had to write a Django migration to update hundreds of thousands of database objects.





