Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 64559 invoked from network); 27 May 2009 22:54:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 May 2009 22:54:13 -0000 Received: (qmail 17001 invoked by uid 500); 27 May 2009 21:47:20 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 16987 invoked by uid 500); 27 May 2009 21:47:20 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 16977 invoked by uid 500); 27 May 2009 21:47:20 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 16974 invoked by uid 99); 27 May 2009 21:47:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 21:47:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 21:47:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3649C234C004 for ; Wed, 27 May 2009 14:46:51 -0700 (PDT) Message-ID: <1991172281.1243460811215.JavaMail.jira@brutus> Date: Wed, 27 May 2009 14:46:51 -0700 (PDT) From: "Christian Schneider (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Created: (CAMEL-1652) Memory leak in File component when using batch processing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org Memory leak in File component when using batch processing --------------------------------------------------------- Key: CAMEL-1652 URL: https://issues.apache.org/activemq/browse/CAMEL-1652 Project: Apache Camel Issue Type: Bug Components: camel-core Affects Versions: 2.0-M1 Reporter: Christian Schneider Priority: Critical Fix For: 2.0-M2 See http://www.nabble.com/convertBodyTo-heap-problem-to23743181.html When using a file endpoint with sorting as start of a route then the files are processed in a batch. In the current implementation this means a List of exchanges is created and given to the batch processing. The list is then traversed and each exchange is processed. This means the list references all exchanges during the whole batch processing. So none of the exchanges can be collected by the garbage collector till the whole batch is fully processed. The problem really becomes bad when the exchanges are large. For example if you use convertBodyTo(String.class) and the files are large. If you have 100 files with 10 MB each then camel will consume 1 GB of heap. What is even worse is that it seems the processing simply stops when the heap is full. I have written a small test that shows the problem and a patch that corrects this problem. I hope this gets into 2.0-M2 as this is a quite serious bug. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.