Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 74079 invoked from network); 12 Mar 2009 11:03:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Mar 2009 11:03:16 -0000 Received: (qmail 16260 invoked by uid 500); 12 Mar 2009 11:03:16 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 15881 invoked by uid 500); 12 Mar 2009 11:03:15 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 15872 invoked by uid 99); 12 Mar 2009 11:03:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Mar 2009 04:03:15 -0700 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; Thu, 12 Mar 2009 11:03:13 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1EC0A234C053 for ; Thu, 12 Mar 2009 04:02:52 -0700 (PDT) Message-ID: <1936416359.1236855772124.JavaMail.jira@brutus> Date: Thu, 12 Mar 2009 04:02:52 -0700 (PDT) From: "Jukka Zitting (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Updated: (JCR-1216) Unreferenced sessions should get garbage collected In-Reply-To: <3232725.1195058262992.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-1216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jukka Zitting updated JCR-1216: ------------------------------- Fix Version/s: (was: 1.6.0) 1.5.5 OK, seems reasonable. Scheduling this for inclusion in 1.5.5 (not in 1.5.4 to avoid introducing extra changes there). Is there some way we could have a reliable test case for this? I know garbage collection is a bit tricky to test for. > Unreferenced sessions should get garbage collected > -------------------------------------------------- > > Key: JCR-1216 > URL: https://issues.apache.org/jira/browse/JCR-1216 > Project: Jackrabbit Content Repository > Issue Type: Improvement > Components: jackrabbit-core > Reporter: Thomas Mueller > Assignee: Thomas Mueller > Fix For: 1.5.5 > > Attachments: referencePatch.txt, softReferencePatch.txt, userSessionPatch.txt, weakReferencePatch.txt > > > If an application opens many sessions and doesn't close them, they are never garbage collected. After some time, the virtual machine will run out of memory. This code will run out of memory after a few thousand logins: > Repository rep = new TransientRepository(); > for (int i = 0; ; i++) { > rep.login(new SimpleCredentials("", new char[0])); > } > Using a finalizer to close SessionImpl doesn't work, because it seems there are references from the (hard referenced part of the cache) to the SessionImpl objects. Maybe it is possible to remove those references, or change them to weak references. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.