I’ve noticed strange Senaite behavior while creating new objects in bulk or generating a lot of analysis reports via Senaite.Impress. Senaite starts to increase memory utilization and no evidence it is going to release any memory later. When it fills all available memory Senaite restarts with no error messages or warnings. After restart memory utilization rate back to normal.
Any advice on where to look/check for?
I suspect it’s more Plone or Zope-related issue, but probably somebody dealt with it before?
Zope keeps objects in memory until the zodb-cache-size is reached, i.e. the number of objects which the ZODB cache will try to hold.
If you run out of memory, try to reduce this number in your buildout.cfg plone.recipe.zope2instance and re-run your buildout.
Anyhow, free memory is wasted memory. This is also the case in Linux environments, which is the reason why memory is never freed and always becomes completely used after a while.
if anyone encounters the same problem. just FYI seems that the reason for such behavior sits in Weasyprint library used by Senaite.Impress for PDF rendering: WeasyPrint Issue #1496
This bug will be fixed later. The latest Weasyprint version uses Python3, so that will be possible to use it after project migration to Python3 I guess
Hi Leonid,
thanks a lot for your efforts tracking this down. I wasn’t aware of this issue and also didn’t notice it on our server monitoring.
How did you work around this issue?
Best regards, Ramon
Well, I can’t say our solution is elegant, but it works.
We do call bash script from our Senaite instance which runs generating routine in Python3 environment and saves result
And even more, we’ve implemented async reports pre-generation because our lab generates a lot of hi-res documents. When Sample becomes ‘Verified’ it renders Reports previews and PDFs in the background and rerenders each time the object modifies.