NIO.2 and GC activity
Mark Thornton
mthornton at optrak.co.uk
Sat Jan 17 01:39:40 PST 2009
Leon Finker wrote:
>
> Hi,
>
> I would like to provide feedback on NIO.2 based on the specs, and what
> I’ve been reading about the implementation.
>
> 1.
>
> I’m drawing from .Net experience here. We have encountered a
> bottleneck with earlier .NET networking implementations,
>
> and I feel that NIO.2 is heading in the same direction. Please correct
> me if I’m wrong.
>
> Proposed NIO.2:
>
> Future<Integer> read(ByteBuffer dst, … CompletionHandler<Integer,?
> super A> handler)
>
> etc…
>
> Earlier versions of .NET:
>
> IAsyncResult BeginReceive(byte[] buffer, …, AsyncCallback callback, …)
>
> The problem is that too many temporary Future/IAsyncResult objects are
> created and thrown away without ability to pool them,
>
> which puts unnecessary stress on the GC.
>
How does the .NET garbage collector compare with those available now in
Java? I have piles of old code that worked around inadequacies in older
garbage collectors (e.g. stuff from the 1.1 era). Today I am frequently
amazed at how good GC is at coping with huge amounts of garbage. So does
Java need this kind of optimization?
Mark Thornton
More information about the nio-discuss
mailing list