Microsoft Office 2016 reporting not enough memory
The problem disappeared when I turned off SourceTree, which was locking files during periodic refresh. I also noticed that Office for Mac has issues with synchronization while working on files that were opened from OneDrive. So if you're having a similar memory problem, make sure that while you work on the document no other program accesses it.

It seems that Microsoft's products just don't handle file access denial well and I'd consider this behavior a bug.