S
Sri Ramaswamy
I need to perform a remote file copy on large files (15-20MB).
I have a handle to a remote object which has access to
inputStreams corresponding to these files. The code that
exposes the the getInputStream() method is part of a 3rd
party library and actually returns a ByteArrayInputStream.
Since I cannot pass back the input stream through RMI,
I am reading the input stream, creating an array of bytes,
returning this byte array through RMI and writing these
bytes to a file, on the other side.
Here are the problems with this approach -
1) I am not sure how this library implements the getInputStream()
method but the jvm crashes with a java.lang.OutOfMemoryError
if the heap size is less than 64MB.
2) This process is very slow.
If you have any thoughts/suggestions on a better approach that
reduces the memory requirement and can speed up this operation,
I would really appreciate it.
Thank you,
Sri Ramaswamy
I have a handle to a remote object which has access to
inputStreams corresponding to these files. The code that
exposes the the getInputStream() method is part of a 3rd
party library and actually returns a ByteArrayInputStream.
Since I cannot pass back the input stream through RMI,
I am reading the input stream, creating an array of bytes,
returning this byte array through RMI and writing these
bytes to a file, on the other side.
Here are the problems with this approach -
1) I am not sure how this library implements the getInputStream()
method but the jvm crashes with a java.lang.OutOfMemoryError
if the heap size is less than 64MB.
2) This process is very slow.
If you have any thoughts/suggestions on a better approach that
reduces the memory requirement and can speed up this operation,
I would really appreciate it.
Thank you,
Sri Ramaswamy