Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 98311 invoked from network); 23 Nov 2009 15:34:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Nov 2009 15:34:01 -0000 Received: (qmail 75650 invoked by uid 500); 23 Nov 2009 15:34:00 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 75597 invoked by uid 500); 23 Nov 2009 15:34:00 -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 75587 invoked by uid 99); 23 Nov 2009 15:34:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Nov 2009 15:34:00 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.219.216] (HELO mail-ew0-f216.google.com) (209.85.219.216) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Nov 2009 15:33:58 +0000 Received: by ewy8 with SMTP id 8so187706ewy.12 for ; Mon, 23 Nov 2009 07:33:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.90.76 with SMTP id d54mr1616772wef.55.1258990416733; Mon, 23 Nov 2009 07:33:36 -0800 (PST) In-Reply-To: References: From: Michael Gentry Date: Mon, 23 Nov 2009 10:33:16 -0500 Message-ID: <5adb61290911230733w5acc11d4oa7a0748131679613@mail.gmail.com> Subject: Re: When can cached objects be garbage-collected? To: user@cayenne.apache.org Content-Type: text/plain; charset=ISO-8859-1 You can try dataContext.unregisterObjects() or dataContext.invalidateObjects() if you need to keep other things in your DC around. If not, throwing away the DC for a new one is a good approach. mrg On Mon, Nov 23, 2009 at 10:19 AM, Andreas Hartmann wrote: > Hi everyone, > > I'm facing the following situation: > > RecipientSet has many Recipients > > A large number of Recipient objects are imported in a single transaction. > The changes are committed e.g. every 100 recipients. Nevertheless the > Recipient objects are kept in the heap, and eventually an OutOfMemoryError > occurs. > > I have the feeling that the Recipient objects cannot be garbage-collected > because of the relationship references from the RecipientSet. I didn't find > any other references to the Recipient objects. > > Is it possible to tell Cayenne not to keep the references, or is there any > other way to handle this issue? Do I have to create a new data context after > the changes are committed, starting with a fresh RecipientSet? > > Thanks a lot in advance for any hints! > > Best regards, > Andreas > > > -- > Andreas Hartmann, CTO > BeCompany GmbH > http://www.becompany.ch > Tel.: +41 (0) 43 818 57 01 > >