harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hindess <mark.hind...@googlemail.com>
Subject Re: [classlib] OSResourceMonitor must go
Date Thu, 01 Oct 2009 09:04:21 GMT

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.

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

View raw message