Ah, I think there was a misunderstanding (hence why I was confused about why you were interested in direct memory usage). When you wrote:
"performance: 10% lesser with direct buffer use"
I thought you meant performance was 10% worse when you used direct buffers.
How long did your test run for? With the Sun JVMs I found a significant initial spike in performance but after it warmed up it performed well. Also what send/receive buffer size are you using?
Could you also test with the latest JRockit JVM?
Unfortunately at the moment I do not have a test application that is standalone. However I think that the sample echo server that comes with MINA could be usable as a performance test of the buffers.
Robert
| Michael Bauroth <[EMAIL PROTECTED]>
01/05/2006 09:33
|
To: [email protected] cc: Subject: Re: Performance - some interesting results |
The problem is, that with my initial tests the direct buffers were
quicker, but more memory consuming. Does it make sense to find out
initially, under which circumstances which behaviour occurs?
I would support you with additional tests too. Robert, have you
eventually a test application for use, so that we can make the tests
with the same code and conditions?
Is there a possibility to decrease the memory consumption from direct
buffers without decreasing their performance?
Regards
Michael
Trustin Lee wrote:
> 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
This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.
