From owner-freebsd-java@FreeBSD.ORG Wed Oct 26 21:00:51 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBDEE16A41F for ; Wed, 26 Oct 2005 21:00:51 +0000 (GMT) (envelope-from past@ebs.gr) Received: from fly.ebs.gr (fly.ebs.gr [62.103.84.177]) by mx1.FreeBSD.org (Postfix) with ESMTP id A91E143D45 for ; Wed, 26 Oct 2005 21:00:47 +0000 (GMT) (envelope-from past@ebs.gr) Received: from ebs.gr (root@hal.ebs.gr [10.1.1.2]) by fly.ebs.gr (8.12.9p1/8.12.9) with ESMTP id j9QL0h9V076019; Thu, 27 Oct 2005 00:00:43 +0300 (EEST) (envelope-from past@ebs.gr) Received: from [10.1.1.200] (pptp.ebs.gr [10.1.1.200]) by ebs.gr (8.13.3/8.12.11) with ESMTP id j9QL0tKW012510; Thu, 27 Oct 2005 00:00:56 +0300 (EEST) (envelope-from past@ebs.gr) Message-ID: <435FEE77.1000606@ebs.gr> Date: Thu, 27 Oct 2005 00:00:39 +0300 From: Panagiotis Astithas Organization: EBS Ltd. User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051008) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Landon Fuller References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-java@freebsd.org Subject: Re: [PATCH] Sun Bug #4879883: Allocating direct buffers causes OutOfMemoryError X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2005 21:00:51 -0000 Landon Fuller wrote: > From http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4879883 > A DESCRIPTION OF THE PROBLEM : > Allocating a direct byte buffer may give an OutOfMemoryError, even when > plenty of memory is available. Although not used in the test case > below, in my application this occurs when reading a socket channel > > ---- > > We ran into this bug with jdk1.4.2; A simple reproduction case is > included in the referenced Sun bug report. > This bug was fixed in 1.5.0 and 1.4.2_05. > > I've back-ported Sun's changes from the 1.5.0 source. The patch (for > 1.4.2-p7) is attached below. > > Please let me know if you have any questions, > -landonf FYI, it works as advertised here. It fixes the reported bug and doesn't seem to break anything in my testing so far. Thanks, Panagiotis