I set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag on python and I still get the memoryerror exceptions. When they start happening there is still more than 1GB of available memory!