Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 64144 invoked from network); 23 May 2007 16:22:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 May 2007 16:22:37 -0000 Received: (qmail 72901 invoked by uid 500); 23 May 2007 16:22:43 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 72880 invoked by uid 500); 23 May 2007 16:22:43 -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 72871 invoked by uid 99); 23 May 2007 16:22:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 09:22:43 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 09:22:37 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E9803714064 for ; Wed, 23 May 2007 09:22:16 -0700 (PDT) Message-ID: <23366269.1179937336954.JavaMail.jira@brutus> Date: Wed, 23 May 2007 09:22:16 -0700 (PDT) From: "Alexey Petrenko (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-3148) [Classlib][nio] alloc many DirectByteBuffers may cause memory-out-error In-Reply-To: <23492583.1171012685830.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-3148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498285 ] Alexey Petrenko commented on HARMONY-3148: ------------------------------------------ Guys, unfortunately this patch does not work on Windows. Here is the memory check code === cut === #define MEMORYLOADTHRESHOLD 95 // 95% #define MEMORYFREETHRESHOLD 0x4000000 //64M hysysinfo_is_system_physical_memory_low (struct HyPortLibrary *portLibrary, UDATA load_threshold, UDATA free_threshold) { MEMORYSTATUSEX stat; stat.dwLength = sizeof (stat); if(GlobalMemoryStatusEx(&stat)) { if(stat.dwMemoryLoad >= load_threshold || stat.ullAvailPhys <= load_threshold){ return TRUE; } === cut === GlobalMemoryStatusEx reports global memory status but not the status for the current process. So we are waiting while full system memory load will be higher then 95% or available physical memory will be less the 95 bytes. I guess that this is usual situation on 512M or even 1G system. But this is not true for my 4G server :) So this fuction always return false for me. And OOM happens after 100 iterations. I undestand that free_threshold and load_threshold parameters are mixed up here. But I believe that putting them in place will not help. So the issue needs additional investigation. > [Classlib][nio] alloc many DirectByteBuffers may cause memory-out-error > ----------------------------------------------------------------------- > > Key: HARMONY-3148 > URL: https://issues.apache.org/jira/browse/HARMONY-3148 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Jimmy, Jing Lv > Assigned To: Alexey Petrenko > Attachments: H-3148_2.patch, patch-3148.zip > > > Hi, > As discussed on mailing-list, DirectByteBuffer uses native memory which is out of GC-control, alloc many DirectByteBuffer may cause memory-out-error if they are not GCed, even they can be GCed at that time. > This happens in Harmony but not in RI. This should be a bug of Harmony. > Note: other native memory users, e.g., java.util.zip.Deflater, may cause this problem as well. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.