In the TCP mode when allocating send buffers we use the ByteBuffer.allocate method. When the graph is very large the amount of memory is being allocated becomes very large because buffer allocation is done for each communication operation in the graph . This leads to out of memory errors since heap space runs out.