This is a tool for testing zero copy using Java.
This tool is using Java NIO and using transferTo function for zero-copy.
required jdk 1.8+
You can compile this tool yourself.
mvn clean comiple package
Alternatively, you can download and use the compiled binary file.
- All parentheses are mandatory
java -jar zerocopy.jar server [port]
- All parentheses are mandatory
java -jar zerocopy.jar [serverInfo(host:port)] [testFilePath] [zerocopy(true|false)]
$ ls
test.txt zerocopy.jar
$ java -jar zerocopy.jar server 9000 &
[1] 2564
$ jps
2579 Jps
2564 jar
$ java -jar zerocopy.jar client localhost:9000 ./test.txt true
Client Usage : java -jar [jarfile] host:port filePath zerocopy
13:07:20.134 [Thread-0] INFO kr.revelope.zerocopy.Receiver - Accepted : java.nio.channels.SocketChannel[connected local=/127.0.0.1:9000 remote=/127.0.0.1:50045]
13:07:20.143 [main] INFO kr.revelope.zerocopy.Sender - Transferred 5bytes.
13:07:20.146 [main] INFO kr.revelope.zerocopy.Sender - Time taken in 3ms.
$ kill 2564
[1]+ Exit 143 java -jar zerocopy.jar server 9000
$ jps
2582 Jps
- English : https://developer.ibm.com/articles/j-zerocopy/
- Korean : https://kgw1988.blog.me