From users-return-16868-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Wed Nov 12 09:32:47 2008 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 21559 invoked from network); 12 Nov 2008 09:32:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Nov 2008 09:32:47 -0000 Received: (qmail 31859 invoked by uid 500); 12 Nov 2008 09:32:53 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 31678 invoked by uid 500); 12 Nov 2008 09:32:51 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 31667 invoked by uid 99); 12 Nov 2008 09:32:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2008 01:32:51 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gary.tully@gmail.com designates 209.85.128.187 as permitted sender) Received: from [209.85.128.187] (HELO fk-out-0910.google.com) (209.85.128.187) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2008 09:31:30 +0000 Received: by fk-out-0910.google.com with SMTP id z22so355649fkz.6 for ; Wed, 12 Nov 2008 01:32:02 -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=KnpMKMILf84hc7AmeIC7y7oe9oM09XrEDKTa75CGvhk=; b=Y8ZRAr49Jwif01Y/tdm/cHMg4JH0pDFqEwEQkxS63SVR29Te/eMiU/Tb2sMcxkyrLr 0dUK8+buctslHhjAgYCwtI5Ge8ITLUtxbEyRudpTrau5ZLEZ4Sq5ArqZFDgedQUDN5RU dp2t7EpAxAionfQjFURAS8wudGRES8HcHExMk= 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=Z52fkfhqlLB0eUPweY7TPyzf3+qQ5tKzQpL52BOCmbZOABCljJlvtxTcKZqovGWc2b Vy1KlScXfF3CLSI5BSiXCEomLEhQvwCYHJ5feWlN6YjnxS2XNUa6NVA97qht06HDksj7 19Z1Fc7CNyyRPwnEwOCxcXqb27+s2ljE8YOR4= Received: by 10.181.48.4 with SMTP id a4mr2790081bkk.59.1226482322782; Wed, 12 Nov 2008 01:32:02 -0800 (PST) Received: by 10.181.47.15 with HTTP; Wed, 12 Nov 2008 01:32:02 -0800 (PST) Message-ID: <3a73c17c0811120132x236f5b4ch1dfcc9b93ac5f91@mail.gmail.com> Date: Wed, 12 Nov 2008 09:32:02 +0000 From: "Gary Tully" To: users@activemq.apache.org Subject: Re: memoryUsage configuration In-Reply-To: <20453099.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20416088.post@talk.nabble.com> <20435735.post@talk.nabble.com> <3a73c17c0811110244x2317573frde9103ddfcc270ac@mail.gmail.com> <20453099.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org sorry, my reply was not that clear. I agree that the use of two memory usage metrics seems a little odd. In other words, it appears to be an anomaly indicative of a bug! My suggestion is that you create a junit test case that shows the 'odd' behavior and attach it to a new jira issue. In addition, submit your changed code as a patch to that jira. (Hence the link to the contributing page) With a valid use case and some further investigation it should be possible to determine the intent and correctness of the code in BaseDestination. If your patch fixes the problem and does not have any undesirable side effects as determined by the junit test suite, we can commit your changes. 2008/11/12 lurga : > > Hi Gary, > Think you for your reply,but I still have some doubt about the 'valid > anomaly' you mentioned . > I was puzzled with this question for some days, and I also attempted to > resolve it by writing some temperory code . > What the most I want to know is why the BaseDestination uses two memory > usage. > I am looking forword your advice. thanks. > > > Gary Tully wrote: >> >> Hi Lurga, >> this seems to be a valid anomaly. >> Please check out the contributing[1] details to see the best way to >> make your changes permanent. >> [1] http://activemq.apache.org/contributing.html >> >> 2008/11/11 lurga : >>> >>> Queue invokes memoryUsage.isFull() method to decide when to block >>> producer >>> sending message, and FilePendingCursor invokes hasSpace() method (uses >>> systemUsage of the Queue) to decide when to flush messages to disk. I >>> made a >>> patch to avoid diverse results from these two different ways of >>> judgement. >>> Now it seems to work correct. >>> >>> Index: >>> activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java >>> =================================================================== >>> --- >>> activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java >>> (revision 712969) >>> +++ >>> activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java >>> (working copy) >>> @@ -141,6 +141,12 @@ >>> memoryUsage.setParent(systemUsage.getMemoryUsage()); >>> } >>> >>> + long memoryUsageHighWaterMark = >>> + Math.min(memoryUsage.getLimit(), >>> systemUsage.getMemoryUsage().getLimit()) >>> + * messages.getMemoryUsageHighWaterMark() >>> + / systemUsage.getMemoryUsage().getLimit(); >>> + messages.setMemoryUsageHighWaterMark((int) >>> memoryUsageHighWaterMark); >>> + >>> if (isOptimizedDispatch()) { >>> this.taskRunner = taskFactory.createTaskRunner(this, >>> "TempQueue: " + destination.getPhysicalName()); >>> }else { >>> -- >>> View this message in context: >>> http://www.nabble.com/memoryUsage-configuration-tp20416088p20435735.html >>> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >>> >>> >> >> > > -- > View this message in context: http://www.nabble.com/memoryUsage-configuration-tp20416088p20453099.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > >