Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 77738 invoked from network); 1 Oct 2009 09:11:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Oct 2009 09:11:04 -0000 Received: (qmail 15953 invoked by uid 500); 1 Oct 2009 09:11:03 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 15860 invoked by uid 500); 1 Oct 2009 09:11:03 -0000 Mailing-List: contact dev-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 dev@harmony.apache.org Received: (qmail 15849 invoked by uid 99); 1 Oct 2009 09:11:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2009 09:11:03 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of oliver.deakin@googlemail.com designates 209.85.218.226 as permitted sender) Received: from [209.85.218.226] (HELO mail-bw0-f226.google.com) (209.85.218.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2009 09:10:52 +0000 Received: by bwz26 with SMTP id 26so2240633bwz.36 for ; Thu, 01 Oct 2009 02:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=yVco9Kj0X07YO5C63zOkQLytaLynZ27fcyLNw0Vjq1I=; b=OubcZkM/PTXchttII7FpisOqKN1oPLJ5g60YGNj3OR8FtAa7fx94iKwMOn3dSjXnMj ug/BFXvGOX/Lr9VtLClfKigQ6YC8TScfq1TNr8+coRC7EQuXIOVgUrtTSaceEgbpk9mi B6Luh2sWabOU8xDH/w1oUvcPRXOjdy3minMbw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=dBFfq6dutje1ozXIu4x8avdBJkt6+/UN2uEsinngdHDcvjLxN8+DX9LnhcwxCoLFC1 50GSHec+bZC1cTcwZ0YJ7E+hkUyDEaw5S3v2fPKcgo92huTbr86fsptLBelAMjWtmDl8 kFGFTdLWp4TY4bGqGmqANuqdRUwR26Tmn4Ai8= Received: by 10.86.227.1 with SMTP id z1mr918692fgg.56.1254388171532; Thu, 01 Oct 2009 02:09:31 -0700 (PDT) Received: from ?9.20.183.66? (blueice4n2.uk.ibm.com [195.212.29.92]) by mx.google.com with ESMTPS id d6sm1499417fga.26.2009.10.01.02.09.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Oct 2009 02:09:29 -0700 (PDT) Message-ID: <4AC471CC.9070602@googlemail.com> Date: Thu, 01 Oct 2009 10:09:32 +0100 From: Oliver Deakin User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: [classlib] OSResourceMonitor must go References: <4AC46E87.3040604@gmail.com> <200910010904.n9194M0M026935@d12av03.megacenter.de.ibm.com> In-Reply-To: <200910010904.n9194M0M026935@d12av03.megacenter.de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Yep, +1 from me as well - this code is too hacky and costly for each malloc. Regards, Oliver Mark Hindess wrote: > Harsh but fair. I'm +1 for removing it. It is a shame there isn't a public > API but this problem should be handled by applications. > -Mark. > > In message <4AC46E87.3040604@gmail.com>, Tim Ellison writes: > >> I propose that the OSResourceMonitor abomination is removed. It sits in >> front of our OSMemory.malloc() calls to check there is enough system memory. >> >> First, it is going to make all our regular mallocs (from Java) slow by >> making these extra JNI + system calls. At least it should be written to >> kick-in when an OOM exception is thrown, not on every call! >> >> Second, it is there IIRC to attempt to solve the problem of NIO direct >> byte buffers. I'm not convinced it will do a good job of that -- >> invoking System.gc() in a loop is hopeful at best, and again taxing >> every call to malloc up from for this is unreasonable. >> >> The current situation is a hack to work around the lack of public API to >> free a direct byte buffer. There is a far better hack available, and >> that is for apps to cast down and call free explicitly, i.e. >> ((DirectByteBuffer)myBuffer).free() >> >> Regards, >> Tim >> >> > > > > -- Oliver Deakin Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU