Archived

This forum has been archived. Please start a new discussion on GitHub.

MemoryLimitException with sequences

Hi,

I am trying send a matrix of double from client to server, i have seen in doc that the best way to do this is with sequences, something like this because the arrays arent implemented in slice (is true??):

module Demo
{

sequence<double> Flotantes;
sequence<Flotantes> Matriz;
interface Suma
{
double sumatorio(Matriz tabla);
};

};

After that i have tried with different sizes but the max. size that i could set in the matrix is 361*361 (130321 positions), i have tried matrix arent square 140*1000 i.e. but the client throw the same exception MemoryLimitException.

.¿What is this limit in bytes or MB?
.¿Is possible increment this limit?

Thanks

Comments

  • matthew
    matthew NL, Canada
    See http://www.zeroc.com/doc/Ice-3.3.1/manual/PropRef.50.11.html#51122 for details on how to increase the maximum message size.
    i have seen in doc that the best way to do this is with sequences, something like this because the arrays arent implemented in slice (is true??):

    Yes, you should use sequences for this. Depending on your architecture, and if you need the performance and you are using C++, you could try using the array mapping for sequences to avoid additional copies of the matrix data. Naturally, this is most useful if you pack the matrix into a single sequence, and not a sequence of sequence.

    See http://www.zeroc.com/doc/Ice-3.3.1/manual/Cpp.7.7.html for details.
  • Property set

    Thank you very much,
    i have set the property by Ice.Config, by console and by code,
    all run ok now:)
  • You may also find this FAQ of interest.

    BTW, if your matrix is sparse, with the majority of elements with the same value, you can optimize things by only transmitting the elements that don't have the default value. For example, for a large matrix containing mostly zeroes, it can be more effective to only send those elements that are non-zero:
    struct MatrixElement {
        short row;
        short col;
        double val;
    };
    
    sequence<MatrixElement> Matrix;
    

    Whether this pays off depends on the size of the values in the matrix, and how many of them do not have the default value. (The above adds four bytes of overhead to each non-default element.)

    Cheers,

    Michi.