Why do I get an insufficient memory exception when transferring large matrix using PutFullMatrix

2 次查看(过去 30 天)
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.

采纳的回答

MathWorks Support Team
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 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

尚未输入任何标签。

产品


版本

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by