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

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.

 채택된 답변

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개)

카테고리

도움말 센터File 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