Return-Path: X-Original-To: apmail-pdfbox-users-archive@www.apache.org Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8DD18188D1 for ; Sun, 13 Dec 2015 13:57:38 +0000 (UTC) Received: (qmail 69163 invoked by uid 500); 13 Dec 2015 13:57:38 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 69132 invoked by uid 500); 13 Dec 2015 13:57:38 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 69118 invoked by uid 99); 13 Dec 2015 13:57:37 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Dec 2015 13:57:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 17E36180499 for ; Sun, 13 Dec 2015 13:57:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.12 X-Spam-Level: X-Spam-Status: No, score=-0.12 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=lehmi.de Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id n1yv5V2NfJN9 for ; Sun, 13 Dec 2015 13:57:32 +0000 (UTC) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.162]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 9DC5220EBA for ; Sun, 13 Dec 2015 13:57:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1450015044; l=999; s=domk; d=lehmi.de; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version: Date:From:References:To:Subject; bh=HBfHbNqiBjd/6NDZ3rUA8R9mh0YyGFNGtmB125vSHtA=; b=WQGzGyHYMC7jZfp0+2D78jg9dDJzDLLhnlxBng79wR8JgFCeVKZtoxPxoUNCVGkrxDK UjtWwP1jj13Sr1i+VUOHwYzeZQpsq5BtbbfYr0W/X5x9xnTgFegsPNID48+NnZQdFzzsw BI0cL5+9DUod5EFdoB0/ACuy/5KKqB+AbnI= X-RZG-AUTH: :LWIAZ0WpaN8UY5o8XRz0jOyrHsdEC+nAE10OdySrgHOkX7NwDPYbpnHUnQU= X-RZG-CLASS-ID: mo00 Received: from [192.168.6.23] (ipservice-092-217-057-022.092.217.pools.vodafone-ip.de [92.217.57.22]) by smtp.strato.de (RZmta 37.14 DYNA|AUTH) with ESMTPSA id Y046b9rBDDvOM00 (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate) for ; Sun, 13 Dec 2015 14:57:24 +0100 (CET) Subject: Re: 2.0.0-RC2 ScratchFileBuffer not closed! To: users@pdfbox.apache.org References: From: Andreas Lehmkuehler Message-ID: <566D7944.2080304@lehmi.de> Date: Sun, 13 Dec 2015 14:57:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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