Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 62232 invoked from network); 31 Mar 2008 15:43:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Mar 2008 15:43:12 -0000 Received: (qmail 63403 invoked by uid 500); 31 Mar 2008 15:43:12 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 63383 invoked by uid 500); 31 Mar 2008 15:43:12 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 63369 invoked by uid 99); 31 Mar 2008 15:43:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Mar 2008 08:43:12 -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; Mon, 31 Mar 2008 15:42:18 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 43A02234C0B9 for ; Mon, 31 Mar 2008 08:40:36 -0700 (PDT) Message-ID: <2091456999.1206978036276.JavaMail.jira@brutus> Date: Mon, 31 Mar 2008 08:40:36 -0700 (PDT) From: "Vasily Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-5523) [drlvm][gc][lang-management][geronimo] MemoryUsage returns incorrect values In-Reply-To: <724772120.1203298715010.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583728#action_12583728 ] Vasily Zakharov commented on HARMONY-5523: ------------------------------------------ Xiao-Feng Li commented in the dev-list: There is gc_free_memory() API, which can be used to compute the used memory. http://article.gmane.org/gmane.comp.java.harmony.devel/32032 > [drlvm][gc][lang-management][geronimo] MemoryUsage returns incorrect values > --------------------------------------------------------------------------- > > Key: HARMONY-5523 > URL: https://issues.apache.org/jira/browse/HARMONY-5523 > Project: Harmony > Issue Type: Bug > Components: App-Oriented Bug Reports, DRLVM > Affects Versions: 5.0M4, 5.0M5 > Reporter: Vasily Zakharov > Attachments: Harmony-5523-classlib.patch > > > The following test demonstrates the problem: > public class Test { > public static void main(String[] args) throws Exception { > System.out.println(java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()); > } > } > Output on RI: > $ java Test > init = 0(0K) used = 162416(158K) committed = 2031616(1984K) max = 66650112(65088K) > $ java -Xms128M -Xmx256M Test > init = 134217728(131072K) used = 166480(162K) committed = 133234688(130112K) max = 266403840(260160K) > Output on Harmony: > $ java Test > MemoryUsage: init=16777216used=16777216committed=16777216max=16777216 > $ java -Xms128M -Xmx256M Test > MemoryUsage: init=134217728used=134217728committed=134217728max=134217728 > Clearly enough, the following problems do exist: > 1. getUsed() method always returns the -Xms value instead of actual used memory amount. > 2. getMax() method returns the -Xms value instead of -Xmx value. > 3. toString() method works incorrectly (output is badly readable). > This issues causes the Geronimo console to display the used memory information incorrectly. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.