Hi,
I have a java program parsing a large noteone file with a size of 1.61GB. I create a com.aspose.note.Document by providing InputStream of the file as parameter:
try (InputStream stream = getInputStream())
{
Document doc = new Document(stream);
}
catch (RuntimeException e)
{
throw new IOException("Error creating document", e);
}
When running the program, I observed it hung there with following call stack until the program exited due to timeout triggered by a watchdog in my program.
at app//com.aspose.note.internal.ay.m.c(Unknown Source)
at app//com.aspose.note.internal.ay.m.b(Unknown Source)
at app//com.aspose.note.internal.foundation.o.a(Unknown Source)
at app//com.aspose.note.Document.a(Unknown Source)
at app//com.aspose.note.Document.<init>(Unknown Source)
at app//com.aspose.note.Document.<init>(Unknown Source)
at app//com.aspose.note.Document.<init>(Unknown Source)
. . .
I can’t provide the noteone file for your testing. But is it expected to have such spin when aspose.note processing huge file? And is there any way to avoid being stuck in the function call in aspose?
Thanks.
@adam.chen
It seems that you are experiencing performance issues when processing a large OneNote file (1.61GB) using the Aspose.Note library in Java. This can happen with large files due to the extensive amount of data being processed, which may lead to delays or even timeouts.
To address this issue, consider the following optimization strategies:
-
Streamlined Processing: Ensure that you are using efficient methods for reading and processing the document. If possible, try to break down the document into smaller parts or process it in chunks to reduce memory consumption and improve performance.
-
Performance Optimization Techniques: There are specific techniques available for optimizing the export performance of OneNote documents. You can refer to tutorials that provide step-by-step guidance on how to enhance the performance of your export operations. These resources can help you fine-tune your Java code for better efficiency.
-
Asynchronous Processing: If the library supports it, consider using asynchronous processing to avoid blocking the main thread while the document is being loaded. This can help prevent your application from hanging.
-
Timeout Configuration: If your application has a watchdog that triggers a timeout, you might want to adjust the timeout settings to allow more time for processing large files, especially if you expect that the operation may take longer than usual.
-
Memory Management: Ensure that your Java application has sufficient memory allocated. You can increase the heap size by adjusting the JVM options (e.g., -Xmx
flag) to allow for more memory usage during processing.
If you continue to experience issues, it may be beneficial to reach out to Aspose support for further assistance, as they can provide more specific guidance based on your use case.
For more detailed information on optimizing performance with Aspose.Note, you can check the following resources:
These tutorials can provide you with valuable insights and techniques to improve the performance of your application when handling large OneNote files.