out of memory ?? help needed
Show older comments
I have a laptop which has a 8G of ram memory.
however, when I run a matlab, it says I am out of memory.
I only run matlab only, and closed all other unnecessary windows.
I am pretty sure I have a sufficient memory to run the matlab program.. but yeah this happend..
Any suggestion or solution for this issue?
I already tried following stuff..
1- Give higher priority to Matlab.exe task. You can do that by going to task manager, Processes tab, right click the Matlab.exe Task, select priority and set it to higher priority (say real time), this tells Windows to allocate more resources to this process.
2- Increase the page file size of your applications in general. You can do this by right clicking MyComputer ->properties->Advanced System Settings ->Advanced-> Performance->Virtual Memory (change..). Then the tick from the Automatic .... and set the initial and maximum page size to say 10000 MB.
3- While in 2 at Performance, make sure that the it is set for "Programs" and not for "Background services". "Programs" should be the default.
4- Also make sure while doing step 2 that the >Visual effects tab of "performance options" is set to "Adjust for best performance" . This will remove lots of animation, shades, fades and and other visual effects from your screen (the next time you re-boot) but free some memory for the applications including the MATLAB. I used this trick with my older laptop which was 32 bits OS and used to have a profound impact on applications performance.
5 Comments
Matt J
on 3 Sep 2014
To be clear, it is the act of launching the MATLAB application itself that causes the problem and the "out of memory" message is from Windows? It does not result from running a program within MATLAB?
Guillaume
on 3 Sep 2014
Also please specify if the OS is 32 or 64 bit and if matlab is 32 or 64 bit. Typing computer in matlab will give you the answer to that last one.
What does memory and whos say when you get the error?
YJ
on 3 Sep 2014
Geoff Hayes
on 3 Sep 2014
How large are the images, and how much data do you extract from each?
M Shujah Islam Sameem
on 3 Dec 2021
Go to Home -> Preference icon -> Workspace" : Uncheck the 'Limit the maximum array size to a percentage of RAM
Accepted Answer
More Answers (4)
mrwen mrwen
on 22 Mar 2017
I solved the problem, and it works well, you can follow these steps.
- Go to Home -> Preference icon -> General -> Java Heap Memory -> Allocate what size of memory you want
- In Preference window, go to "Workspace" (out of Java heap memory level) -> See "Matlab Array size limit"
Make sure uncheck the 'Limit the maximum array size to a percentage of RAM'. Because you want to extend memory
so we don't need this feature.
- Done.
Julia
on 3 Sep 2014
1 vote
Hi,
I once got an out-of-memory error while using a feature of the report generator.
I solved it by allocating more java heap memory to Matlab:
Preferences (in the Matlab tab "Home") --> General --> Java Heap Memory
Mohsin Ali
on 20 Oct 2015
Edited: Mohsin Ali
on 20 Oct 2015
hi i am using 64 bit version of matlab on 64 bit operating system windows 7. I am facing the same problem I have increasing the jave heap size and tried all the above recommendations. my computer specifications are, i am using it on Intel Xeon having 64GB of RAM. Matlab shows following results when I ran 'memory' and 'whos' commands
Maximum possible array: 124730 MB (1.308e+11 bytes)
Memory available for all arrays: 124730 MB (1.308e+11 bytes)
Memory used by MATLAB: 1014 MB (1.064e+09 bytes)
Physical Memory (RAM): 65535 MB (6.872e+10 bytes)
Limited by System Memory (physical + swap file) available.
Name Size Bytes Class Attributes
Problem 1x1 172686122 struct
cnt 1x1 8 double
index 1x1 1339842 struct
q 148770x148770 171455800 double sparse
x 1x1 8 double
y 1x1 8 double
1 Comment
Guillaume
on 20 Oct 2015
Please start your own question rather than posting a question in an answer. And particularly, state what problem you are facing. As you've got tons of memory surely you're not running out of memory?
Note that changing OS settings (like process priority, page file size, etc.) without knowing the implication is not a good idea. The benefit may be marginal and result in instabilities.
Particularly, increasing the java heap size will reduce the memory available to matlab for array allocation. Just because it says memory in the setting does not mean it has anything to do with the memory used by matlab for arrays. This is memory used for java that affects things like GUI.
Kalai Chelvi
on 21 Nov 2016
0 votes
HI, Am using a lap with 4GB RAM, 64 bit Win-7 OS and 64 bit Matlab-2013 version. When I am trying to use 'wavedec' command for an image of size 217x181 for level 1, I got "out of memory" error. Can any one tell me how to rectify it please ???
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!