Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5xAi-00070p-EK for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Mar 2019 18:39:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h5xAg-0001Mp-Tx for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Mar 2019 18:39:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5xAg-0001MH-Jw for pgsql-bugs@lists.postgresql.org; Mon, 18 Mar 2019 18:39:38 +0000 Received: from server01.webapps.manitu.net ([217.11.48.33]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5xAd-0004Ws-4D for pgsql-bugs@lists.postgresql.org; Mon, 18 Mar 2019 18:39:37 +0000 Received: from webmail.manitu.de (localhost [127.0.0.1]) by server01.webapps.manitu.net (Postfix) with ESMTP id 0F818AA0093; Mon, 18 Mar 2019 19:39:32 +0100 (CET) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_d68289d9dde874f5c6e833406c3ff5a7" Date: Mon, 18 Mar 2019 19:39:32 +0100 From: Matthias Otterbach To: Jeff Janes Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15700: PG 10 vs. 11: Large increase in memory usage when selecting BYTEA data (maybe memory leak) In-Reply-To: References: <15700-8c408321a87d56bb@postgresql.org> Message-ID: <710a95e27d884885a39c8236bd51440f@otterbach.eu> X-Sender: mo@otterbach.eu User-Agent: Roundcube Webmail/1.3.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=_d68289d9dde874f5c6e833406c3ff5a7 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Dear Jeff, dear pgsql-bugs list, thanks for your reply. Am 2019-03-18 19:15, schrieb Jeff Janes: > On Mon, Mar 18, 2019 at 7:01 AM PG Bug reporting form > wrote: > >> The Java program actually just executes "SELECT b FROM public.a" and >> keeps >> streaming more rows doing something with the content, also the >> execution >> plan for my query is fairly simple - actually it seems to be just a >> sequential scan (with both versions). > > Could you include as an attachment a complete compilable java program? > Including the imports, the main public class definition, etc. Of course that is possible, you find the program attached. You should be able to compile and execute it using the following command lines (maybe change the host, username and password before compilation as they are unfortunately hard-coded currently): - Compilation: /your/path/to/javac TestMemoryIssue.java - Execution: /your/path/to/java -cp "/your/path/to/postgresql-42.2.5.jar;." TestMemoryIssue If it matters, I used openjdk version "11.0.1" 2018-10-16 OpenJDK Runtime Environment 18.9 (build 11.0.1+13) OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode) for compilation and execution of the program. But as the same program worked against a PG 10 database I suppose that the Java version should not matter. Best regards, Matthias Otterbach --=_d68289d9dde874f5c6e833406c3ff5a7 Content-Transfer-Encoding: base64 Content-Type: text/x-c; name=TestMemoryIssue.java Content-Disposition: attachment; filename=TestMemoryIssue.java; size=1069 aW1wb3J0IGphdmEuc3FsLkNvbm5lY3Rpb247DQppbXBvcnQgamF2YS5zcWwuRHJpdmVyTWFuYWdl cjsNCmltcG9ydCBqYXZhLnNxbC5QcmVwYXJlZFN0YXRlbWVudDsNCmltcG9ydCBqYXZhLnNxbC5S ZXN1bHRTZXQ7DQoNCnB1YmxpYyBjbGFzcyBUZXN0TWVtb3J5SXNzdWUgew0KDQogIHB1YmxpYyBz dGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBUaHJvd2FibGUgew0KICAgIFN0 cmluZyBzcWwgPSAiU0VMRUNUIGIgRlJPTSBwdWJsaWMuYSI7DQogICAgdHJ5IChDb25uZWN0aW9u IGNvbm5lY3Rpb24gPQ0KICAgICAgICBEcml2ZXJNYW5hZ2VyLmdldENvbm5lY3Rpb24oImpkYmM6 cG9zdGdyZXNxbDovLzEyNy4wLjAuMTo1NDMyL3Bvc3RncmVzP2N1cnJlbnRTY2hlbWE9cHVibGlj IiwgInVzZXJuYW1lIiwgInBhc3N3b3JkIikpIHsNCiAgICAgIGNvbm5lY3Rpb24uc2V0QXV0b0Nv bW1pdChmYWxzZSk7DQogICAgICB0cnkgKFByZXBhcmVkU3RhdGVtZW50IHBzID0gY29ubmVjdGlv bi5wcmVwYXJlU3RhdGVtZW50KHNxbCkpIHsNCiAgICAgICAgcHMuc2V0RmV0Y2hTaXplKDUpOyAv LyB3ZSBkbyBub3Qgd2FudCB0byBydW4gb3V0IG9mIEphdmEgaGVhcCBzcGFjZQ0KICAgICAgICB0 cnkgKFJlc3VsdFNldCBycyA9IHBzLmV4ZWN1dGVRdWVyeSgpKSB7DQogICAgICAgICAgaW50IGkg PSAwOw0KICAgICAgICAgIHdoaWxlIChycy5uZXh0KCkpIHsNCiAgICAgICAgICAgIC8vIGp1c3Qg bG9vcCBvdmVyIGFsbCBkYXRhLCBnZXQgdGhlIGRhdGEgYW5kIGRvIHNvbWV0aGluZyB3aXRoIGl0 DQogICAgICAgICAgICBpKys7DQogICAgICAgICAgICBieXRlW10gYiA9IHJzLmdldEJ5dGVzKDEp Ow0KICAgICAgICAgICAgaWYgKGkgJSAxMCA9PSAwIHx8IGIgPT0gbnVsbCB8fCBiLmxlbmd0aCA8 PSBpKSB7DQogICAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigiUm93ICIgKyBpICsgIjog IiArIChiICE9IG51bGwgPyBiLmxlbmd0aCA6IG51bGwpKTsNCiAgICAgICAgICAgIH0NCiAgICAg ICAgICB9DQogICAgICAgIH0NCiAgICAgIH0NCiAgICB9DQogIH0NCn0NCg== --=_d68289d9dde874f5c6e833406c3ff5a7--