Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Aug 10, 2023 1:09 pm

Hello,

This is our environment:
Library: Spire.Office library version: 6.10.3
OS: WIndows 10/11
Dev environment: .NET Core 6.0
Deployed at: Kubernetes (dotnet-runtime:6.0-alpine), ServerVersion: "v1.25.8+k3s1", Compiler:"gc", Platform:"linux/amd64"

We are having a problem that Spire.PDF library, that is converting different files into PDF, increase RAM and CPU usage during the time of use and we need to restart the our microservice that is using it, to free the RAM and CPU. We would like to optimize Spire library usage with some recommended techniques that don't create possible memory leaks.

We have also a problem with some multi page TIFF file that we want to convert to PDF. Spire library just crash when we try conversion to PDF. This Multi-page TIFF has 350 pages and we (maybe) get out of available RAM. What is the RAM consumption per page when converting some multipage document (Word, Multi-page TIFF) to PDF? For testing purposes we transformed one PDF book into 350 page multi-page TIFF and it was around 230MB, and on one PC with 32GB RAM it went through after maybe 2-3 minutes of processing and on another PC with less RAM it crashed with message:
"Failed to read the request form. Multipart body length limit 134217728 exceeded."

Sending you a ZIP with our code snippet in C# (how we use it) and also screenshot of CPU and RAM consumption of microservice that use Spire.Office library. It consume 6 CPUs (more than any other service we have).

Can you tell us if there is any way to improve it to manually free used resources (maybe some manual garbage collecting) after the operation is finished?

We would welcome some hints to optimize the usage of SPIRE library and to free more resources (if possible) and especially some hints how we can force cleaning the garbage collected stuff after transformation is finished.

bradjen
 
Posts: 29
Joined: Thu Jul 25, 2019 6:07 am

Fri Aug 11, 2023 7:02 am

Hi,

Thank you for your inquiry regarding the issues you are experiencing with the Spire.PDF library. After reviewing your feedback, we have some recommendations and clarifications to address the mentioned problems.

Firstly, we recommend that you upgrade to the latest version of the Spire.Office library. The version you are currently using is from approximately two years ago, and since then, there have been several updates and improvements to the library. Upgrading to the latest version may resolve some of the performance and resource usage issues you are encountering.

Regarding the optimization of the product's performance, we understand your concerns. However, optimizing the library's performance can be a complex task that involves substantial code modifications across multiple components. It would require a comprehensive review and analysis of the existing codebase.

Regarding the second issue related to the error message "Failed to read the request form. Multipart body length limit 134217728 exceeded," it appears that this error is not directly related to our product. This error message typically indicates that there is a limitation set within your project for the maximum size of uploaded documents. We suggest checking the configuration of your project or microservice and adjusting the upload document size limit accordingly.

We hope that upgrading to the latest version of the Spire.PDF library and modifying the upload document size limit will help resolve the issues you are facing. If you need further assistance or encounter any additional problems, please do not hesitate to reach out to us.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.PDF