Hello guys,
Due to the limitations of 32-bit systems and the need to handle very large arrays in MATLAB I'd like to know whether there is a good free memory defragmenter so that the maximum array size becomes close to the amount of free RAM.
Thanks in advance for any tips!
-
-
There is no point in getting one on Vista.
If you need more RAM than is free then Vista will page out stuff to make space for it.
Also, if you trully have huge amounts of data that need to be in the memory, you may be better off with a 64Bit System and more RAM - not sure if Matlab supports 64Bit though. -
ScuderiaConchiglia NBR Vaio Team Curmudgeon
Gary -
The off switch is the best memory defragmenter available.
Vista (and Server 2003+ and Win7) have this thing called memory space randomization. Among lots of other things, it means that you'll never get a 'real' contiguous chunk of ram bigger than a certain amount. I seem to remember that this is 16Mb but I could be mis-remembering.
The OS will give an application as much ram as it's asking for, the details of the memory allocation are all hidden under the covers as it should be. -
jackluo923 Notebook Virtuoso
Off switch does not defragment your memory.
There's no need to defrag your memory hense the name "RAM -random access memory".
How much ram do you have?
If you have around 3-4GB, the maximum ram you can use is 2GB per program unless you use the "3GB" trick to lift the limit. -
hoe do you use the 3gb trick?
-
But you have to have access to more than 3GB of RAM to use it. Most computers in a 32bit OS can only use 3.25-3.5GB of RAM, so the 3GB flag leaves VERY little RAM to the OS and that WILL cause problems.
Not worth risking. If you really need more RAM for MATLAB, I suggest you try out 64bit Vista or Linux (MATLAB should support it).
And you do not need to defragment RAM, there is no point. Also, the OS will make sure the programs get the RAM they ask for (up to 2GB) using paging techniques and stuff of that sort. It is transparent to the application, and you don't need to worry about that. -
Wow, thanks a ton greg. i have acess to 4gig of ram and going by what your saying i dont need to go the windows boot command way
-
jackluo923 Notebook Virtuoso
If you're using 32bit OS, it's impossible to have access to 4gig of ram because essential devices takes away some memory addressing space.
If your program needs more than 2GB of memory, time to upgrade to 64bit OS and get more ram, maybe with the exception of virtual machines.
I had 8 virtual machine running couple month ago. It used 3.5GB of ram and around 8-10GB of page file. -
There are a couple of problems involved here.
Each application has its own virtual address space. When you allocate memory, it needs to be in a contiguous chunk in the application's address space. The memory doesn't have to be contiguous in RAM (ie. the OS's address space) because each page in the application's virtual address space can map to any arbitrary page in the OS's address space.
Hence, defragmenting the OS's address space won't help - you need to defragment the application's virtual address space if you want to allocate massive chunks of memory. And that's usually not possible - to relocate a piece of memory in an application's address space, you need to find all references to that memory and update them to point to the new address. Unless the application was written using a garbage collected language, it's not possible.
The solution, as others have mentioned, is to use a 64-bit OS and find a 64-bit version of MATLAB (if possible). -
Yes, of course Matlab is available in a 64bit version, and getting that together with a machine with plenty of memory is the only way to handle very large arrays in Matlab. Note that simply installing a 64bit OS on your current machine will not do much for you. If you go to the Mathworks web site there are some additional pointers and advice on that topic as well (so, for example, a clean reboot with a minimal number of loaded applications does help, to some extent).
A good memory defragmenter?
Discussion in 'Windows OS and Software' started by HerrKaputt, Jun 10, 2009.