フィルターのクリア

Can I fix 'Out of Memory' error by attaching an external drive?

9 ビュー (過去 30 日間)
Lina Gannon
Lina Gannon 2021 年 4 月 12 日
編集済み: Stephen23 2021 年 4 月 13 日
I have an external hard drive with lots of storage, I am not sure how much space my computer has, but probably not a ton so I am hoping this will help. I moved the matlab file to the external drive and tried to run it there and had the same issue.
I am running a kinda big computation, I am making a 9000*9000 matrix, but as soon as I make it right, I use sparse, but overall still a big computation going on.
If the drive can help, how can I make my computer utilize that space?
Thank you!
  1 件のコメント
Stephen23
Stephen23 2021 年 4 月 13 日
編集済み: Stephen23 2021 年 4 月 13 日
You might be confusing computer memory with your hard-drive storage:
  • computer memory (aka "primary storage") is used by the OS to load programs into and store data while they are being processed. Must be fast to access (to match the CPU speed) and is thus expensive.
  • hard-drive (aka "secondary storage", also includes tape drives, optical drives, etc.) are used for non-volatile storage. These days is often quite cheap (per bit), but in general can be much slower to access than volatile memory.
"I am not sure how much space my computer has, but probably not a ton so I am hoping this will help."
In general no: a hard-drive is not primary computer memory. Although it is possible to configure the OS to use the hard-drive as part of virtual memory, this generally slows down data processing. There is no real subsitute for fast computer memory.
"space" is an ambiguous term, it is not clear if you are referring to computer memory or data storage.
"I moved the matlab file to the external drive and tried to run it there and had the same issue."
Of course, because changing where files are saved does not change the computer memory (which is what MATLAB uses for the data when it is imported).

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

採用された回答

David Fletcher
David Fletcher 2021 年 4 月 12 日
Unfortunately a hard disk is a poor alternative to physical RAM. Whilst it is possible to get Windows to use the hard disk as virtual memory, it is a painfully slow alternative. If you want to try it, have a look here, or google setting up virtual memory.
  2 件のコメント
Lina Gannon
Lina Gannon 2021 年 4 月 12 日
Thank you! I just tried making more space on my computer, I have 50/117 free GB, is that a lot or a little? last week my code was working mostly so I am not sure what could be going on.
Thanks!
David Fletcher
David Fletcher 2021 年 4 月 12 日
編集済み: David Fletcher 2021 年 4 月 12 日
Given the size, I'm guessing it's an SSD - this will be faster than the older mechanical hard drives, but they are still not really designed as a substitute for physical RAM and are still many orders of magnitude slower than the dedicated RAM inside your computer. The size of the pagefile is generally recommended to be between 1.5 to 4 times the size of your physical memory.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by