pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hewson <j...@jahewson.com>
Subject Re: PDFRenderer, PDDocument memory issue
Date Tue, 07 Jul 2015 04:33:44 GMT

> On 1 Jul 2015, at 23:29, Andreas Lehmkühler <andreas@lehmi.de> wrote:
> 
> 
> 
>> John Hewson <john@jahewson.com> hat am 2. Juli 2015 um 06:10 geschrieben:
>> 
>> 
>> 
>>> On 1 Jul 2015, at 07:52, Tilman Hausherr <THausherr@t-online.de> wrote:
>>> 
>>>> Am 01.07.2015 um 10:16 schrieb Alex Sviridov:
>>>> In my application I have real time memory graphs and they show that memory
>>>> is very fast filled.
>>>> When there is no more free memory getPageThumbImage hangs - no exception,
>>>> nothing. But the code stops.
>>>> When I do pdfDocument=null,pdfRenderer=null I get about 400mb free memory.
>>>> How to solve this problem?
>>> 
>>> If you're building from source, try this: in PDImageXObject.java, remove the
>>> line "cachedImage = image;". This will consume less space if you have large
>>> PDFs with many images.
>> 
>> We don't retain XObjects across pages (anymore), so that shouldn't be the
>> cause of his gradual memory increase?
> IMHO, it's quite simply to explain. During the initial parse all streams are
> read and all the data is stored in COSStream (see COSParser#parseCOSStream).
> That isn't a new behaviour and I'm working on a better solution (it's my last
> TODO in PDFBOX-2301)

So it’s cached data in COSStream? That wouldn’t be affected by "cachedImage = image;”
but it would certainly explain the increasing heap usage. Glad to hear that you have an
improvement underway!

— John

>>> Tilman
>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
> 
> BR
> Andreas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message