Rank: Newbie
Groups: Registered
Joined: 9/25/2019(UTC) Posts: 1 
|
I am evaluating the Pdfium.Net for use in my organization and was surprised by a memory failure. The test PDF is a large file, ~200 pages of an industrial supply catalog, in which I am searching for a large number of products. This means iterative searches and a high percentage of searches that return no results. I've reduced the code to the following and the memory leak continues. A single execution of this routine and process memory rises 750 MB. However, if I replace the search text with a value that is actually on the page, the process memory change is negligible. I interpret this to mean that PdfText.Find() is not disposing of resources when it returns null (i.e., no results). Is there another way I can structure my search to avoid the problem? Is this a bug that can be fixed quickly? I am testing with version 4.17.2704 downloaded through NuGet just now. Code:
private void button1_Click(object sender, EventArgs e)
{
PdfCommon.Initialize();
catalog = PdfDocument.Load(textBoxCatalogFile.Text);
PdfPage page = catalog.Pages[4];
for (int i = 0; i < 100000; i++)
{
PdfFind results = page.Text.Find("NotOnThePage", FindFlags.MatchWholeWord, 0);
if (results != null)
{
// Do something
results.Dispose();
}
}
page.Dispose();
catalog.Dispose();
}
Thank you
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
|
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close