Dwg file format is highly compressed and drawing occupied much more memory than file size.
Memory limit for 32-bit application is 2G. 64-bit application has no such limitation.
In some scenarios partial loading and paging can reduce memory usage but saving drawing to file require that all data is loaded into memory.