I'm trying to create a 75col by 650k rows document using openpyxl write only workbook, which is said to bear near constant memory footprint, but after a while I get 17.2GB memory usage in activity monitor, here's the code I'm using, am I doing something wrong?
def testOPENPYXL():
wb = openpyxl.Workbook(write_only=True)
ws = wb.create_sheet()
for irow in range(650000):
ws.append(['%d' % i for i in range(75)])
path = os.path.expanduser("~/Desktop/test/test.xlsx")
wb.save(path)
The simple solution is to install lxml
we have a shim in openpyxl that mimics lxml's streaming writer but it isn't as memory efficient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With