Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 44337 invoked from network); 1 Feb 2008 09:53:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Feb 2008 09:53:23 -0000 Received: (qmail 15684 invoked by uid 500); 1 Feb 2008 09:53:15 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 15359 invoked by uid 500); 1 Feb 2008 09:53:14 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 15349 invoked by uid 99); 1 Feb 2008 09:53:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2008 01:53:14 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thomas.tom.mueller@gmail.com designates 64.233.166.183 as permitted sender) Received: from [64.233.166.183] (HELO py-out-1112.google.com) (64.233.166.183) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2008 09:52:46 +0000 Received: by py-out-1112.google.com with SMTP id u77so1424370pyb.15 for ; Fri, 01 Feb 2008 01:52:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=AVW/sveym3l13AhcU9PRX6lDn2pZnJbilFU+MMZdZTQ=; b=C5Qh2MG2+6jkcThacZiKnui6DP1pIdvqGC5eWPM0hIGW7h1NhQoKNvljOxNupKN6YOnMNGhNIcNcFDAlZKl3gY1KgvxKLbzHrzft6NqmuZmnwrtTRACQ3xNwiyyDS8kQ7itqhx0E7R85N/ujMgFZnDhJZlOIPnrXGl/Wlso8BMA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=N4TrjyFU5Rz3sozSLjc5O3Rywuvim73wbSDqlxJ0o91Qsl2vlS2pZSgF0ImR0+uLndr65RptQkqGwn17kNk3ye7vFDNJroGPKfWYhar2bzYLC2kSWJynTMv5Ycu+/GEfnULkG6diQmVBSTqpojFbEopyLKlbzplcGH1Afj3pQFs= Received: by 10.142.242.8 with SMTP id p8mr1962503wfh.70.1201859571670; Fri, 01 Feb 2008 01:52:51 -0800 (PST) Received: by 10.142.241.8 with HTTP; Fri, 1 Feb 2008 01:52:51 -0800 (PST) Message-ID: <5f211bd50802010152i1189f0f4gfab6e819ec48a285@mail.gmail.com> Date: Fri, 1 Feb 2008 10:52:51 +0100 From: "Thomas Mueller" To: users@jackrabbit.apache.org Subject: Re: NameFactoryImpl$NameImpl In-Reply-To: <690980.98367.qm@web38614.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <690980.98367.qm@web38614.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, Would it be possible for you to create a simple, standalone test case (that means, no external dependencies except Jackrabbit core, a single class with a main method, similar to the FirstHop examples)? Best would be if the memory problem can be reproduced using the standard configuration; if not, could you also send the configuration you use? Getting rid of the duplicate Strings would be fairly easy (using a simple string cache), but we need to be sure we have a test case so we know we solve the right problem. Thanks, Thomas On Jan 23, 2008 5:51 PM, Andrey Adamovich wrote: > Hello guys! > > We have implemented JCR facade for our portal system based on JackRabbit. Facade delegates it's calls to JackRabbit repository, and if data is not available, a request to a legacy CMS is performed and data is inserted into JackRabbit. > > The structure of repository is similar to: > > /root//////////textProperty > > Number of possible path values at each level is from 2 to 20. > id and sub_id are unique identifiers of the document, under them document structure is stored with maximum depth of 5. Many documents have the same type of structure and property names. > > We faced some performance bottlenecks and I have tried to profile our application (with YourKit Java Profiler) and I have noticed that there are many duplicate strings stored on the heap and most of those duplicates (I mean almost all of them) are contained by org.apache.jackrabbit.spi.commons.name.NameFactoryImpl$NameImpl class instances. > > After doing several portal page requests (which would mean about 1000 JR requests) and taking memory snapshot I have noticed that string "root" is stored and contained by NameImpl about 12000 times, which is about 2Mb waste. Also other strings with values of the repository level names and property names had from 11000 to 3000 duplicates. The total calculated waste is about 50Mb and that is only after not that many requests. > > It is probably not the only memory/performance bottleneck and it also could be that our app is doing something wrong, but it would be good to get some ideas on that from you guys. > > After leaving server alone and not doing anything on that for a while (6-8 hours), I have taken memory snapshot again and the number of duplicates has slightly reduced, but I would not say that it changed a lot or many of the duplicate strings have been garbage-collected. > > I have also looked at the source of NameFactoryImpl$NameImpl and found that it uses String.intern() for name space storing, but not for local name part, which is wise in general, but may not work if JackRabbit is stressed to have too many requests. > > Therefore I have several questions, that some of you may help me with: > > 1) Is there a way to implement different name creation strategy? I see that NameFactory is an interface, but how would I plug in different implementation to adapt to my repository structure, so, that "root" string would not be stored 12000 times or even more? > > 2) Can someone explain me how JR cache manager works and can this leak happen because of cache manager storing to many states? Is the size of JR cache depends on the live session number? Would it be wise to disable it? or at least limit it? > > Best regards, > > Andrey > > > > ___________________________________________________________ > Support the World Aids Awareness campaign this month with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/