pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkuehler <andr...@lehmi.de>
Subject Re: 2.0.0-RC2 ScratchFileBuffer not closed!
Date Sun, 13 Dec 2015 13:57:24 GMT
Hi,

Am 02.12.2015 um 01:16 schrieb Adam Retter:
> Hey guys,
>
> Using either 2.0.0-RC1 or 2.0.0-RC2 I am seeing a lot of debug
> messages which look like:
>
> "ScratchFileBuffer not closed!"
>
> When I trace this it appears that this is called by `finalize` being
> called on the ScratchFileBuffer.
>
> I am opening and closing my PDDocument by using try-with-resources, i.e.
>
> try(final PDDocument doc = PDDocument.load(pdf.asFile)) {
> ...
> }
>
> As far as I can see I am not manually specifying any Scratch files,
> are there any known issues with these not being correctly freed in
> 2.0.0?
It looks like the finalize is faster than the auto-close.
So, the question is, do you dereference the doc instance right at the end of 
your try-with-resources block or is something memory consuming/else done before 
reaching the end so that there is enough time for the garbage collection to be 
ran before (automatically) calling doc.close?

> Cheers Adam.

BR
Andreas


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


Mime
View raw message