Libreoffice CentOS Covertion High Memory Use (pyuno)

Problems: I have a conversion program using pyuno in CentOS, Normally the memory is 600M (2G). Atfter I run the conversion program(Input: 3.4M, including picture watermark), the memory runs up to 1.5G (2G).
Programs:

  1. Convert pdf to each picture (102pages, and the pictures are saved locally)
  2. Add each picture to Drawer, then save as a pdf (all the pictures are deleted locally).
  3. Close the original input pdf (using code: document.close(True))
  4. I run the server daemonly :
soffice
           --headless
            --invisible
            --nocrashreport
            --nodefault
            --nologo
           --nofirststartwizard
            --norestore
            -env:UserInstallation=self.user_installation

Questions: How to make the memory back to original level after the convertion, I have explicitly close the input document, and save the output document locally.

which one ?
https://www.baeldung.com/linux/resident-set-vs-virtual-memory-size

I know the tools, I want to know the memory increase is caused by:
(1) my program (code from: GitHub - unoconv/unoserver)
(2) pyuno itself (memory leak itself?)
code