フィルターのクリア

How can I clear the RAM memory used by MATLAB without closing the window?

76 ビュー (過去 30 日間)
André Brás
André Brás 2017 年 11 月 28 日
コメント済み: Matthew Creek 2023 年 8 月 24 日
Hello everybody, I need your help!
I am using MATLAB and the Kinect for Windows to acquire the skeletal data and everything is going fine. However, after a while, I get an error due to insufficient free RAM memory. The acquisition is stopped and I try everything to clear the memory: clear, clear all, clearvars -global, close all, but nothing works - the memory is not cleared and I can't acquire more data.
Can anybody tell me a command to clear the RAM memory without closing the window?
Thank for your attention. Best regards.
  2 件のコメント
Juan  Reyes
Juan Reyes 2018 年 6 月 12 日
Hello André, Did you find the solution? I'm having kind of the same problem here. Thank you!
Adhiti Raman
Adhiti Raman 2018 年 7 月 21 日
I'm having the same issue. Did either one of you find out how to fix this?

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

採用された回答

Jan
Jan 2018 年 7 月 21 日
There are 2 causes for an exhausted RAM:
  1. The code requires more RAM than you have.
  2. There is a memory leak in the code. While this is very rare in Matlab code, it can happen in C code very easily. Posting the used code would help to identify the problem.
In the case 1., the standard solutions are:
  • Install more RAM
  • Use 64 bit versions of Matlab and OS
  • Close other applications
  • Use the smallest suitable data type. If you store a list of data, which has integer values from 0 to 255, using a double requires 8 byte per element, while an uint8 needs 1 byte only.
  • Increase the virtual memory of the operating system
  • But the most powerful solution is point 1: Install more physical RAM. More more more.
For case 2.: We cannot guess the reasons without seeing the code or at least the names and versions of the used libraries and Matlab.
  2 件のコメント
Adhiti Raman
Adhiti Raman 2018 年 7 月 23 日
In this case, I don't think more RAM was the answer. I have 16 GB RAM, which should have been more than enough. I don't know why the error showed up, but deleting the imaq object with imaqreset before running my code again worked.

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

その他の回答 (1 件)

Adhiti Raman
Adhiti Raman 2018 年 7 月 23 日
編集済み: Adhiti Raman 2018 年 7 月 23 日
So I fixed this error by running imaqreset at the start of my code.

Community Treasure Hunt

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

Start Hunting!

Translated by