[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Messaging and Remoting

ovidiu.feodorov@jboss.com do-not-reply at jboss.com
Mon Oct 23 19:37:17 EDT 2006


Tim wrote : 
  | This doesn't make any sense to me.
  | NIO and streams don't work well together. 
  | 

Where exactly did you see the word "stream" in the Remoting API extension document?

Tim wrote : 
  | ovidiu.feodorov at jboss.com wrote : 
  |   | Not necessarily, the Remoting implementation can create ByteBuffers by wrapping the byte[] we send as an argument without copying anything, but I don't see any problem with using ByteBuffer instead of byte[] in the method signature.
  |   | 
  | 
  | I don't think wrapping the buffer around a byte[] works with direct byte buffers.
  | 

The memory allocated when creating a direct buffer is outside of the JVM heap. The allocation is done through native methods, and it's likely to be significantly more expensive than creating non-direct buffers.

I am not saying that we shouldn't use ByteBuffers for the low-level access API, I am saying that we should be very careful how we handle them, and what kind of buffers we pass around, so the drawbacks don't outweigh the speed advantages obtained by having I/O devices writing directly in the memory areas managed by direct buffers. 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980227#3980227

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980227



More information about the jboss-dev-forums mailing list