[Python] [Writer] Memory consumption?

Keyboard macros or custom scripts

[Python] [Writer] Memory consumption?

Postby yijinger » Mon May 10, 2021 7:35 pm

Hi all,

I'm somewhat disturbed by how much RAM LibreOffice consumes while running in hidden mode. My script creates about 90 text documents (.odt files), writes them in a temporary folder, then compiles into one document. Source files are about 100-400 KB each, with some OLE objects in them, and the resulting document is about 5 MB. I also run automatic PDF export, and PDF is about 11 MB. LibreOffice (soffice.bin process as I see it in Gnome System Monitor) takes about 5 GB RAM for this task according to Linux system monitor, so I decided to look deeper. I run psutil.Process(office_pid).memory_info(), then show all dictionary members in a log. There are 7 of them: RSS, Data, Shared, Text, VMS, Lib and Dirty. Two first members show actually used pages, as I understand. VMS is just some system reserve for the process, so I do not care much about it. "Shared" increases to about 100 MB and remains at this level, while RSS and Data increase to 5,6 GB each! And I call doc.dispose() after I finish to work with each file, both source and result. The most mysterious increase happens after adding of page numbers: from 4GB to those 5,6 GB - just for numbering 140 pages with a single field.

The first question I want to ask: is it normal to take so much RAM? And if not, how these numbers can be decreased?
LibreOffice on Linux Mint 20
Posts: 12
Joined: Fri Apr 02, 2021 8:00 am

Return to OpenOffice Basic, Python, BeanShell, JavaScript

Who is online

Users browsing this forum: No registered users and 3 guests