On 5/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Out of curiosity, why do you not use -server? One serious issue with direct buffers is that you can declare a lot of them, throw away the reference and the memory will not be reclaimed until the GC kicks in. This may not be for some time since it depends what is in the heap. Even if you allocate huge direct buffers it isn't going to make GC happen any more quickly. I think it would have been better if ByteBuffer had a dispose() method. Since you find that heap buffers offer better performance for you, is the greater memory footprint with direct buffers really an issue for you?
This thread definitely raises very interesting performance issues as you mentioned initially. Most modern JVMs are showing that heap buffers show better performance and memory utilization than direct buffers do. The buffer pooling was originally to save time to allocate direct buffers because it usually takes a lot of time comparing to the time taken while heap buffers are allocated. If heap buffers are much better choice for most cases, then we need to adjust our default allocation behavior. If we change the default buffer type to 'heap', we'll also have to change the default allocator to SimpleByteBufferAllocator. WDYT? Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6
