Rocketmq is Alibaba's open-source MQ.
The Network implementation of rocketmq depends on netty.
Http://my.oschina.net/plucury/blog/192577 this article describes netty's zero copy implementation:
According to the description in the article, "sendfile () in Linux and filechannel in Java NiO. the transferto () method implements the zero copy function. "It seems that" filechannel. transferto () and sendfile () are implemented at the same layer. "netty encapsulates the filechannel of NiO in fileregion. transferto ().
At the same time, netty has another form of zero copy, that is, netty allows us to merge multiple segments of data into a whole segment of virtual data for users to use, without the need to copy the data during the process. Netty uses compositechannelbuffer to form a virtual channelbuffer for operations in user space. In this process, only the reference of channelbuffer is operated.
--------------------------- I am a split line.
However, if compared with the scope of C's capabilities, Java's limitations are exposed.
C can rewrite some network software stacks to directly send data from the DMA or Nic buffer, without even having to finish the entire network stack (Java can only be stunned ~)
Http://blog.csdn.net/jiangbo_hit/article/details/6146502 to add a reference, content is what you guess