Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 22833 invoked from network); 7 Jul 2006 01:39:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jul 2006 01:39:22 -0000 Received: (qmail 4445 invoked by uid 500); 7 Jul 2006 01:39:21 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 4226 invoked by uid 500); 7 Jul 2006 01:39:20 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 4217 invoked by uid 99); 7 Jul 2006 01:39:20 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jul 2006 18:39:20 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jul 2006 18:39:20 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A7D0441043E for ; Fri, 7 Jul 2006 01:37:30 +0000 (GMT) Message-ID: <22835991.1152236250684.JavaMail.jira@brutus> Date: Fri, 7 Jul 2006 01:37:30 +0000 (GMT+00:00) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-1472) Avoid expanding object to memory before sending it to server. In-Reply-To: <2090505.1151731291667.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-1472?page=all ] Bryan Pendleton updated DERBY-1472: ----------------------------------- Attachment: test.java I do not know the answer to your question. I experimented with sending BLOB columns from a network client program (see attached 'test.java'), and when I ran the program I observed the following: 1) On the client side, the BLOB does not seem to be materialized into memory when the input stream is used. I was able to run the client using a very small amount of memory (appx 10 Mb) even when I sent very large files as BLOB. 2) On the server side, the BLOB does seem to be materialized into memory, possibly multiple times. Using this test program, I was able to send a 235 Megabyte file as a BLOB from the network client to the server. The Network Client memory never got higher than 10 Mb. However, I had to give the server a very large memory setting (-Xmx1024m) in order to load the 235 Megabyte BLOB into the table. I also tried sending a 600 Megabyte file as a BLOB from the client to the server. Again, the client memory usage was very small, but the server memory usage was extreme. I was not able to set the memory setting high enough to be successful; even when I ran the server with -Xmx1536m, which is as high as I could get on my machine, the server still got OutOfMemoryError. I also stepped through the code in org.apache.derby.client.net.Request's writeScalarStream() method, and that code appears to be written very carefully such that it does NOT materialize the entire BLOB on the client side, but rather reads the stream in 32K chunks and writes them directly out to the network. So, my conclusion is that I *cannot* reproduce DERBY-550 and I am *not* able to verify a memory usage problem on the client side; only on the server side do I observe a problem. I hope this is helpful to you. > Avoid expanding object to memory before sending it to server. > ------------------------------------------------------------- > > Key: DERBY-1472 > URL: http://issues.apache.org/jira/browse/DERBY-1472 > Project: Derby > Type: Improvement > Components: Network Client > Reporter: Tomohito Nakayama > Assignee: Tomohito Nakayama > Attachments: test.java > > Object , such as blob/clob, is expanded to memory before sending it to server. > This behavior easily causes OutOfMemoryError, and it is desirable to remove this process of expanding . -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira