alexlance / signal-message-exporter

Export SMS, MMS, and Signal messages out of Signal
39 stars 6 forks source link

~quarter memory usage on file writing #6

Closed thinkbrown closed 1 year ago

thinkbrown commented 1 year ago

I've got a ~16GB Signal backup that I'm attempting to convert and was unable to run this script without a MemoryError upon trying to write the file (on a 64GB machine). Switching to the minidom writexml method reduced that to ~30GB of memory usage.

Opening this as a draft because I've yet to actually attempt ingesting the file on my phone

alexlance commented 1 year ago

Hi there - I just tested on my backup file and provided the line is changed to this:

root.writexml(f, encoding="utf-8", standalone="yes")

then it generates the same exact XML file as before the change. Any chance you could add the extra line to your PR - happy to merge!

thinkbrown commented 1 year ago

Updated the encoding and confirmed that it doesn't affect the memory footprint

alexlance commented 1 year ago

Brilliant thank you :+1: