Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 52214 invoked from network); 23 Jul 2007 13:30:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jul 2007 13:30:13 -0000 Received: (qmail 75021 invoked by uid 500); 23 Jul 2007 13:30:01 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 74984 invoked by uid 500); 23 Jul 2007 13:30:01 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 74962 invoked by uid 99); 23 Jul 2007 13:30:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2007 06:30:00 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jean-paul.lefevre@cea.fr designates 132.166.172.103 as permitted sender) Received: from [132.166.172.103] (HELO sainfoin.extra.cea.fr) (132.166.172.103) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2007 06:29:58 -0700 Received: from cyclose2.extra.cea.fr (cyclose2.extra.cea.fr [132.167.198.23]) by sainfoin.extra.cea.fr (8.13.8/8.13.8/CEAnet-Internet.7.0) with ESMTP id l6NDTbjm018279; Mon, 23 Jul 2007 15:29:37 +0200 Received: from orpin1.extra.cea.fr (orpin1.extra.cea.fr [132.167.198.4]) by cyclose2.extra.cea.fr (8.13.8/8.13.8) with ESMTP id l6NDTa4C015696; Mon, 23 Jul 2007 15:29:36 +0200 (envelope-from jean-paul.lefevre@cea.fr) Received: from dappcj205.extra.cea.fr (dappcj205.extra.cea.fr [132.166.9.205]) by orpin1.extra.cea.fr (8.13.8/8.13.8/CEAnet-Extranet-out-1.0) with ESMTP id l6NDTaoc021011; Mon, 23 Jul 2007 15:29:36 +0200 From: Jean-Paul Le =?iso-8859-1?q?F=E8vre?= Organization: CEA DAPNIA To: user@cayenne.apache.org Subject: Out of memory exception when creating a large number of objects Date: Mon, 23 Jul 2007 15:29:35 +0200 User-Agent: KMail/1.9.4 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200707231529.36162.jean-paul.lefevre@cea.fr> X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm trying to import a pretty big amount of data into my database. The input is a xml formatted file. It describes more than 10 millions of objects each having tens of attributes. The application parses the input= =20 file, creates the cayenne objects and commits the changes if requested. As you can imagining I'm facing difficulties trying to avoid out of memory errors. Unfortunately, at this point, I'm still unable to load my big input file. To figure out what it's happening I'm monitoring the application behavior with jconsole. My tactic is the following : every 10000 objects (this number is a parameter) I call rollbackChanges() or commitChanges(). When I run the program in rollback mode It turns out that the memory used oscillates between a min and a max value as expected : after each rollback the garbage collector feels free to cleanup the memory. But in commit mode the amount of memory keeps on increasing and the=20 application fails eventually. I've tried to call unregisterNewObjects() and startTrackingNewObjects() aft= er the commit : ctxt.commitChanges(); ctxt.getObjectStore().unregisterNewObjects(); ctxt.getEntityResolver().clearCache(); ctxt.getObjectStore().startTrackingNewObjects(); but it didn't help. It seems that cayenne keeps reference of newly created objects somewhere preventing the gc from working. Would you have an idea how to fix the problem ? Thanks, =2D-=20 ___________________________________________________________________ Jean-Paul Le F=E8vre * Mail : LeFevre@fonteny.org