フィルターのクリア

out of memory because of large matrixs and vectors

1 回表示 (過去 30 日間)
jafar
jafar 2015 年 9 月 16 日
編集済み: James Tursa 2015 年 9 月 16 日
I have written a code which generate large vectors and matrices.
for example a 1*100000000 dimension matrix must generated during the main code, but "out-of-memory" error occurred.
how can I fix it?
Thank you in advance
  2 件のコメント
James Tursa
James Tursa 2015 年 9 月 16 日
編集済み: James Tursa 2015 年 9 月 16 日
A double vector of that size is 763MB. How much memory do you have? What do you get when you type the following at the command line:
memory
jafar
jafar 2015 年 9 月 16 日
Maximum possible array: 9936 MB (1.042e+10 bytes) *
Memory available for all arrays: 9936 MB (1.042e+10 bytes) *
Memory used by MATLAB: 1060 MB (1.111e+09 bytes)
Physical Memory (RAM): 7868 MB (8.250e+09 bytes)
  • Limited by System Memory (physical + swap file) available.

サインインしてコメントする。

回答 (1 件)

James Tursa
James Tursa 2015 年 9 月 16 日
Please show the code you are using to create these vectors and matrices. Are you sure you are not inadvertently attempting to create a large matrix instead of a vector? E.g.,
V = zeros(1,N); % <-- creates a 1 x N vector
M = zeros(N); <-- creates a N x N matrix
  2 件のコメント
jafar
jafar 2015 年 9 月 16 日
its a simple view of my code:
C=reshape((B)'*A(2,:),[1,D]);
which B is 1x10477456 double
and A is a 3x4116 double
and D=4114*10477456
James Tursa
James Tursa 2015 年 9 月 16 日
編集済み: James Tursa 2015 年 9 月 16 日
D is a 321 GB array. So no, you can't allocate that much memory ... hence the error. You will need to reformulate your problem and maybe try to work it in pieces.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePerformance and Memory についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by