Why do I get an insufficient memory exception when transferring large matrix using PutFullMatrix
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 9 Apr 2018
Answered: MathWorks Support Team
on 18 Apr 2018
The customer is executing MATLAB code from the C# code. When transfering 12424x14666 matrix via PutFullMatrix(), the customer receives the following error saying
Out of memory exception: Infufficient memotry to continue the execution of the program.
The code works fine when the size of the matrix is much smaller. The size of the matrix is approx. 5 GB and the machine has 64 GB memory.
Accepted Answer
MathWorks Support Team
on 9 Apr 2018
This restriction with large arrays seems to be imposed by Microsoft and does not seem to be specific to MATLAB. According to Microsoft MSDN documentation, One of the reasons for this exception is when an attempt to create a large array (exceeding 2GB) in a 64-bit process is made in a .NET process. Please refer to the following link for more information on possible reasons for this exception:
Please find the sub section "You are attempting to create a large array in a 64-bit process" in "Remarks" section of the above link to obtain detailed explanation about this exception.
As a workaround for this issue, try to create and send smaller matrices from C# and combine them in MATLAB if possible. If that is not possible, contact Microsoft technical support to use configuration file setting to enable arrays whose total size exceeds 2 GB.
0 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!