Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
EOutOfMemory DrawLine/DrawPath |
Post Reply |
Author | ||
fellafoo
Team Player Joined: 21 May 22 Location: Simsbury, CT Status: Offline Points: 21 |
Post Options
Thanks(0)
Posted: 25 Jul 22 at 8:29PM |
|
Hello, I'm hoping someone can help me with an out of memory error I'm getting while making repeated calls (around 13,000) to DrawLine and StartPath, AddLineToPath, DrawPath. The debugger breaks at...
...in DebenuPDFLibraryPageTree.pas. I noticed the crash occurs when DrawLine X1 = X2 and Y1 = Y2. I put a test prior to the call for example:
The crash no longer occurs, but a lot of vectors are missing from the output. Do I need to do this test, and if so, should I use a 'near-identical' test? Thank You, MFM
|
||
fellafoo
Team Player Joined: 21 May 22 Location: Simsbury, CT Status: Offline Points: 21 |
Post Options
Thanks(0)
|
|
Well,
I take back my statement about matching points. In my latest test, about 1800 lines with matching endpoints are drawn before the crash occurs. So, I'm not sure where to look next. MFM
|
||
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
|
Is is a genuine out-of-memory condition? Have you checked for a leak using the full version of FastMM? If you suspect you are really out of memory, and you are using 32-bit, does the same happen when you use 64-bit?
|
||
fellafoo
Team Player Joined: 21 May 22 Location: Simsbury, CT Status: Offline Points: 21 |
Post Options
Thanks(0)
|
|
I'm not convinced it's an out-of-memory condition. With this particular test file, the error occurs around 10,000 paths/lines. I can create PDFs containing 30 - 40K paths/lines from other sources without error.
So, I'm trying to narrow down which set of vectors is causing the crash. I haven's used FastMM and building a 64bit test is not an option for me.
|
||
fellafoo
Team Player Joined: 21 May 22 Location: Simsbury, CT Status: Offline Points: 21 |
Post Options
Thanks(0)
|
|
Update:
Perhaps it has something to do with memory. I've been able to create A, B, and C size sheets using the same data. However, each time I try D (24"x36") the crash occurs.
|
||
fellafoo
Team Player Joined: 21 May 22 Location: Simsbury, CT Status: Offline Points: 21 |
Post Options
Thanks(0)
|
|
When I drop the Dpi to 300, I'm able to output a 24x36 sheet. However, I'm surprised because I'm only writing vector data. Why would the Dpi make a difference in this case?
And why don't other documents fail at 600 dpi with more vectors? |
||
fellafoo
Team Player Joined: 21 May 22 Location: Simsbury, CT Status: Offline Points: 21 |
Post Options
Thanks(0)
|
|
Unfortunately, dropping the Dpi to 300 doesn't always work. Here's the 'typical' call stack for what it's worth...
|
||
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
|
I don't think you have much chance of finding the actual problem by trying different parameters which do and do not cause a crash, although you may be able to identify the limits. Since I never use QPDF to draw lines and paths, I do not have a feel for whether 13000 is a big number or not. But I do debug Delphi applications and exceptions.
I would start from the exception message, which may not show the same address as the break in the debugger if the debugger cannot see the source at the exception address. If you have an exception you must have the address at which it occurs. If this is an address in your main program, and you have a link map, then you can find which module that is. If it is not in your main program, use Process Explorer to show DLL load addresses (before the crash occurs) and you will know which DLL it is in, and if you have a link map for the DLL, which module. If the exception address is not in your process at all, then you are out of luck, but at least you know more: that it is most likely a bug causing a stack overwrite or wild branch. If the exception is in the memory manager, then it is worth investing in the time to get the version of Fastmm which provides easy-to-use monitoring and debugging features. But if it is not in the memory manager, the knowledge acquired by all this may lead you to a module for which the 'QPDF source' (which it sounds as if you have) does not include the source. I wish you luck!
|
||
fellafoo
Team Player Joined: 21 May 22 Location: Simsbury, CT Status: Offline Points: 21 |
Post Options
Thanks(0)
|
|
This is looking like 'bloat' I am unintentionally creating when writing the vector data to the PDF document. So, I need to find where, perhaps, I'm writing duplicate data or something along those lines. Is there a way to look at the 'guts' of the file I'm creating to see what the duplicate data might be?
|
||
fellafoo
Team Player Joined: 21 May 22 Location: Simsbury, CT Status: Offline Points: 21 |
Post Options
Thanks(0)
|
|
Here's the order of events when I create a simple file with two rectangles. One is made up of 4 lines and the other is a polyline.
|
||
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
|
I seem to be the only user in the forum who has commented, and I have to drop out now, because as I said I am not familiar with using these specific functions in QPDF. Maybe someone else here who knows more about these functions and their possible limitations can help you.
|
||
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3529 |
Post Options
Thanks(0)
|
|
I'm not able to help but i've searched through the forum here regarding similar issues.
Perhaps the links below let you go a step ahead... Links regarding similar Probs perhaps with good hints: http://www.quickpdf.org/forum/forum_posts.asp?TID=3254&KW=DrawLine&PID=12948&title=speed-up-running-time#12948 http://www.quickpdf.org/forum/forum_posts.asp?TID=3031&KW=DrawLine&PID=12210&title=slow-line-draw-speed#12210 http://www.quickpdf.org/forum/forum_posts.asp?TID=2776&KW=DrawLine&PID=11323&title=generated-pdf-files-are-too-large#11323 http://www.quickpdf.org/forum/forum_posts.asp?TID=3031&KW=DrawPath&PID=12213&title=slow-line-draw-speed#12213 Perhaps helping links: http://www.quickpdf.org/forum/forum_posts.asp?TID=3010&KW=DrawPath&PID=12136&title=path-definition-and-drawing#12136 http://www.quickpdf.org/forum/forum_posts.asp?TID=2124&KW=DrawPath&PID=9040&title=how-to-draw-hatches#9040 |
||
Cheers,
Ingo |
||
fellafoo
Team Player Joined: 21 May 22 Location: Simsbury, CT Status: Offline Points: 21 |
Post Options
Thanks(0)
|
|
Thank you for your insight Tim.
|
||
fellafoo
Team Player Joined: 21 May 22 Location: Simsbury, CT Status: Offline Points: 21 |
Post Options
Thanks(0)
|
|
Thanks Ingo, I'll check these out.
|
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions 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 |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store