The buffer size option in SFTP is -b buffer_size
It specifies the buffer size used for data transfer. The default is 32768 bytes. The minimum allowed value is 1024. The maximum allowed value is 4194304 bytes.
I would need to profile the application for available heap and set this buffer size accordingly so that application does run out of heap and throw a OOME.