8

"DMA" here means: Direct memory access, and "RDMA" is: remote direct memory access.

I used Java to created an application to transfer stock data, but I found the latency is bigger than I expected. I heard someone developed same type application used "DMA/RDMA", which has good performance, so I wonder if I can use "DMA/RDMA" in Java?

If not, what language should I use, and if there are any good libraries to use?

Freewind
  • 193,756
  • 157
  • 432
  • 708

6 Answers6

6

This article from IBM developers work give a great overview of how DMA access can be achieved using java

LordDoskias
  • 3,121
  • 3
  • 30
  • 44
  • 1
    The article shows how to allow other parts of the OS to do DMA on Java-created data and achieve zero-copy data transfers. (Cool, if you ask me.) – 9000 Oct 19 '11 at 11:36
  • @LordDoskias, thank you, zerocopy is a good advice, I will try it later – Freewind Oct 19 '11 at 11:40
  • 1
    Well in order to achieve DMA access of any kind you HAVE to rely on the underlying OS. So each JVM version has platform-specific code which exposes this capability through means of filechannels. So in a sense you are getting all the goodies that come from using DMA – LordDoskias Oct 19 '11 at 11:42
3

You have two options (that I know of):

  1. Java SDP -- has been deprecated
  2. JXIO [1], a high-performance messaging library built on RDMA and supported by Mellanox

[1] https://github.com/accelio/JXIO

JC1
  • 657
  • 6
  • 21
  • Also JSOR from IBM: https://www.ibm.com/support/knowledgecenter/en/SSYKE2_7.1.0/com.ibm.java.lnx.71.doc/diag/understanding/rdma_jsor.html – Mike Argyriou Sep 19 '19 at 09:12
2

There is DiSNI, a new library to program RDMA in Java. DiSNI is the open source variant of IBM's jVerbs. There are some performance numbers here that illustrate how RDMA with Java compares to sockets in C and Java, and also to RDMA in C.

Community
  • 1
  • 1
pstuedi
  • 141
  • 1
  • 5
1

RDMA as I know it is a property of the networking infrastructure (along with the relevant kernel modules etc), not of the application-level programming language.

In other words, you'd have to get specialized kit to make use of RDMA to reduce network latency. Here is an example of a 10GbE network card that supports RDMA: link.

NPE
  • 486,780
  • 108
  • 951
  • 1,012
0

Java 7 supports SDP protocol on Solaris and Linux (with OpenFabrics.org drivers). Unfortunately SDP protocol has been deprecated in the 2.x version of OFED. People resort to JNI wrappers like jVerbs.

Andy Malakov
  • 797
  • 8
  • 6
0

Java applications are capable of mmaping files via nio packages. Those mmaped files can be accesses by multiple programs - I affraid this is closes thing to DMA available in java

Konstantin Pribluda
  • 12,329
  • 1
  • 30
  • 35