Transfer Files with ICE

kdobbkdobb Member Klaus DobblerOrganization: personProject: the project is for the synchronization of files in network with multiple peers

Hi,

I'm trying to send files over network with ICE in Java.
I've defined an interface to send a file as byte-array and I'm wondering how to optimize memory usage of my program.

As far as i observed, there is a maxMessageSize property, which i set to e.g. 50MB.

If I send e.g. a file with 50 MB with ICE, I guess memory consumption of my program() increase fastly, especially when i use multithreading. Also I observed that, e.g. between two successive method invocation at the receiver the garbage collector of Java does not free the memory.

what is the best/recommended way to transfer 'large' files with ICE?

Regards Klaus

Comments

  • benoitbenoit ZeroC Staff Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    Hi Klaus,

    As you discovered, transferring large amounts of data with a single invocation can end up consuming large amounts of memory. To reduce this memory consumption, you'll need to send the file in several chunks of equal size (it could be 512KB, 1MB chunks, ...). This will ensure that each thread consumes a fixed amount of memory instead of depending on the file size. This does require the client & server to keep state on the current file transfer.

    Cheers,
    Benoit.

  • kdobbkdobb Member Klaus DobblerOrganization: personProject: the project is for the synchronization of files in network with multiple peers

    Hi Benoit,

    thanks for your message.

    with ~ 1MB chunks, memory consumption is much lower.

    Regards Klaus

Sign In or Register to comment.