Loading a 484x585x6626 matrix in Matlab, computer freeze and matlab shut down, but.....

1 回表示 (過去 30 日間)
"Hello, I just tried to load a .mat file (600 megabytes, 484x585x6626) in Matlab (Linux, Ubuntu, Matlab 2023b), and it was impossible. My computer froze, and Matlab terminated the operation or just shut down. So, I downloaded GNU Octave and tried the same. I could load the file easily. Can someone please explain why? Does Matlab have issues handling large files?"
  2 件のコメント
Claudio Iturra
Claudio Iturra 2023 年 9 月 14 日
編集済み: Claudio Iturra 2023 年 9 月 14 日
I tried the same on two different computers with Matlab, and the same behavior occurred. I also attempted to load the file via Matlab/Terminal matlab -nodesktop -nojvm.
Claudio Iturra
Claudio Iturra 2023 年 9 月 14 日
I could load the file via Matlab on a MacBook computer with 32 GB of RAM. In contrast, when using Octave, my computer with 16 GB of DDR4 2600 RAM could load the file without any problems. Does this imply that Matlab consumes too much RAM on its own?

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

採用された回答

Walter Roberson
Walter Roberson 2023 年 9 月 14 日
format long g
bytes = 484*585*6626*8
bytes =
15008685120
kilobytes = round(bytes / 1024, 1)
kilobytes =
14656919.1
megabytes = round(kilobytes / 1024, 1)
megabytes =
14313.4
gigabytes = round(megabytes / 1024, 1)
gigabytes =
14
The file is not 660 megabytes.
  7 件のコメント
Walter Roberson
Walter Roberson 2023 年 9 月 14 日
The facilities that @Dyuman Joshi pointed out can be very useful, but they are at their best for -v7.3 files. With -v7 files (the default for most people) it is not promised that the facility will be able to do any better than to effectively load the entire variable and then trim away the unwanted parts. -v7.3 files are organized a completely different way, using a library that was designed to be able to do partial loading of variables.
This can lead to situations where you might find that you load a -v7 file on your 32 gigabyte Mac, write out a copy of the data as a -v7.3 files, getting out a file that will likely be over 1 gigabytes.. but which your other system can load in pieces.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWhos についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by