Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B0DC8200BC2 for ; Thu, 17 Nov 2016 10:48:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id ADDFC160B0B; Thu, 17 Nov 2016 09:48:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 01BFD160AFF for ; Thu, 17 Nov 2016 10:48:13 +0100 (CET) Received: (qmail 60226 invoked by uid 500); 17 Nov 2016 09:48:13 -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 60210 invoked by uid 99); 17 Nov 2016 09:48:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2016 09:48:12 +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 7210A180538 for ; Thu, 17 Nov 2016 09:48:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.3 X-Spam-Level: X-Spam-Status: No, score=-0.3 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 42pv1D6evjZ7 for ; Thu, 17 Nov 2016 09:48:10 +0000 (UTC) Received: from mail.dvag.com (outbound.dvag.de [185.64.157.51]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 6FBBD5FC4A for ; Thu, 17 Nov 2016 09:48:09 +0000 (UTC) Received: from dvagln04.id.dvag.com (dvagln04.id.dvag.com [10.61.10.144]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.dvag.com (Postfix) with ESMTP id 73D2A1C0048 for ; Thu, 17 Nov 2016 10:47:38 +0100 (CET) In-Reply-To: <70874614-e0e2-968d-cb20-e253ce2ecbf0@t-online.de> References: <70874614-e0e2-968d-cb20-e253ce2ecbf0@t-online.de> To: users@pdfbox.apache.org MIME-Version: 1.0 Subject: Antwort: Re: Problems with ScratchFileBuffer and Finalizer: OutOfMemory X-KeepSent: 1151C3AE:406337E5-C125806E:0034AD53; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3FP6 November 22, 2013 From: Tjard Kopka Message-ID: Date: Thu, 17 Nov 2016 10:47:28 +0100 X-MIMETrack: Serialize by Router on Gemini/srv/DVAG at 17.11.2016 10:47:38, Serialize complete at 17.11.2016 10:47:38 Content-Type: multipart/alternative; boundary="=_alternative 0035C916C125806E_=" archived-at: Thu, 17 Nov 2016 09:48:14 -0000 --=_alternative 0035C916C125806E_= Content-Type: text/plain; charset="utf-8" content-transfer-encoding: quoted-printable Hello, all the Finalizer-Instances in the heap dump have a reference to=20 ScratchFileBuffer-Instances: class java.lang.ref.Finalizer @ 0xc0005768 System Class=20 |- java.lang.ref.Finalizer @ 0xed44ed10=20 | |- java.lang.ref.Finalizer @ 0xed43c9b0=20 | |- org.apache.pdfbox.io.ScratchFileBuffer @ 0xed44ecd0 where as example java.lang.ref.Finalizer @ 0xed44ed10=20 has as referent; org.apache.pdfbox.io.ScratchFileBuffer @ 0xed44ecd0 I think the reason herefore is the overriden finalize method in=20 ScratchFielBuffer: @Override protected void finalize() throws Throwable { try { if ((pageHandler !=3D null) && LOG.isDebugEnabled()) { LOG.debug("ScratchFileBuffer not closed!"); } close(); } finally { super.finalize(); } } I found this as a possible goog explanation for our out of memory crashes: Objects which override this method (finalize) need to called by a=20 background thread call finalizer, and they can't be cleaned up until this=20 happens. If these tasks are short and you don't discard many of these it=20 all works well. However if you are creating lots of these objects and/or=20 their finalizers take a long time, the queue of objects to be finalized=20 builds up. It is possible for this queue to use up all the memory. Thanks Tjard [excerpt from memory analysis snipped] >=20 > Nevertheless, do you have a quick fix or workaround for us? No... from what I see, the 70,1% are not pdfbox but java itself?! Consider updating to the current 1.8 JDK version... if the problem=20 doesn't go away, try reproducing it with files you can share. --------------------------------------------------------------------- Deutsche Verm=C3=B6gensberatung Aktiengesellschaft DVAG M=C3=BCnchener Stra=C3=9Fe 1 60329 Frankfurt am Main Vorstandsvorsitzender: Andreas Pohl Mitglieder des Vorstandes: Dr. h.c. /HLU Udo Corts, Hans-Theo Franken, Chri= stian Glanz,=20 Lars Knackstedt, Dr. Helge Lach, Robert Peil, Dr. Dirk Reiffenrath Aufsichtsratsvorsitzender: Friedrich Bohl Sitz der Gesellschaft: Frankfurt am Main Handelsregister Frankfurt HRB 15511 USt-Ident.-Nr.: DE 114 139 839 Erlaubnis- und Aufsichtsbeh=C3=B6rde nach =C2=A7 34c GewO: Stadt Frankfurt = am Main, Ordnungsamt, Kleyerstra=C3=9Fe 86, 60326 Frankfurt am Main=20 Erlaubnis- und Aufsichtsbeh=C3=B6rde nach =C2=A7 34f GewO: IHK Frankfurt am= Main, B=C3=B6rsenplatz 4, 60313 Frankfurt am Main=20 Gemeinsame Registerstelle f=C3=BCr =C2=A7 34d GewO und =C2=A7 34f GewO:=20 Deutscher Industrie- und Handelskammertag (DIHK) e.V.=20 Breite Stra=C3=9Fe 29, 10178 Berlin, Telefon 0180 600585-0=20 (20 Cent/Anruf aus dem deutschen Festnetz, h=C3=B6chstens 60 Cent/Anruf aus= Mobilfunknetzen)=20 www.vermittlerregister.info oder www.vermittlerregister.org=20 Registernummer nach =C2=A7 34d GewO: D-LYYB-BSPX5-17=20 Registernummer nach =C2=A7 34f GewO: D-F-125-93J4-60=20 ---------------------------------------------------------------------=20 --=_alternative 0035C916C125806E_=--