I have some matlab code that will only run on 32 bit windows, but I need atleast 6 gb of ram to run it. In my lab the only machine that has 6gb ram is running 64 bit windows, is there some way to run this code on here? I am thinking of emulating a 32 bit windows and running it on that, will that work?
Your 32 bit application will only be able to address 4 GB when running as a 32 bit process on Windows 64 bit. In order to address more memory you need a 64 bit application.
64 bit Windows will run 32 bit Windows programs just fine. But the 32 bit programs won't be able to access 6 Gb or memory, so I'm not sure that help you.
I'm pretty sure most versions of 32 bit Windows(as in, everything but Server editions) limit a single process to 2GB by default and to 3GB by changing a setting... though it is technically possible to access 16G of RAM from a Pentium Pro(and higher) CPU in 32 bit mode, I don't think anything but Windows Server takes advantage of it
and for your Matlab program to take advantage of it, you'd have to do some interesting multi-process work to manually page between 3G memory banks
You cannot access 6GB of RAM from a 32-bit application. This leaves you two options:
Either you optimize your code to use less RAM, or you make your Matlab program 64-bit compatible.
For the first option, the fine folks at stackoverflow can help you.
For the second option: No part of Matlab that I'm aware of is 32-bit only - unless you have a 32-bit Matlab version. However, if you have an active maintenance contract, you can download and install the 64-bit version of Matlab. If your code calls mex-functions that are compiled for 32-bit Windows, you can try and recompile them for 64-bit Windows.
Hi
I've recently been engaged in moving several of our large Matlab codes from 32-bit Windows XP to 64-bit Windows XP. Unlike one or two of the other answerers here, I think 6GB is a perfectly reasonable memory requirement these days; the largest desktop we use here has dual quad-core processors and 32GB RAM. Some of my scientist colleagues want more, but then they always want more.
I'd go further and advise against trying to rewrite your application to use less RAM; that would be heading in the wrong direction. It will be cheaper and quicker and generate fewer errors if you port your code to the 64-bit machine. To those who would argue for refactoring to use less RAM I would say At what point in the near future will you face up to the realities of the market and recognise that 64-bit computing is here to stay and that RAM is quite cheap, especially compared to the expense of developers time ?
Forget trying to use 6GB RAM on a 32-bit machine; as others have told you, Matlab and Windows won't do it. But, as others have remarked, Matlab is indifferent to the number of bits, so a pure Matlab code which works on a 32-bit release will work on the 64-bit version of the same release. If you move from an older 32-bit release to a newer 64-bit release you may find some Matlab functions have been retired, but you'd have the same issues moving to the newer 32-bit release anyway.
If you have a code which will only run on 32-bit Windows then I suspect you are using MEX files. These will have to be recompiled for execution on a 64-bit machine. Again, be careful to watch out for functionality which has been retired if you are moving between Matlab releases as you port. The other chief gotcha, in my experience, is false assumptions that you might make about the sizes of certain fundamental data types. Neither the Fortran nor the C standards (no C++ experience to speak of) actually specify the size in bytes of default INTEGER (for Fortran) or int (for C -- I think, not much of a C programmer). Pointer sizes are probably only vaguely specified too. What this means is that you may have to either (a) change a lot of variable declarations in your code or (b) use compiler directives/flags to specify default sizes for INTEGERS, REALS, ints and possibly others. (b) is easier, (a) is probably preferable for future maintainability.
Regards
Mark
You can not use 6 GB with 32Bit addresses. A 32 Bit address can only contain values from
0 to 0xffffffff (== 4294967295 == 4GB)
Such addresses are used by and are essential for every 32 Bit program, regardless if you explicitly use pointers or not.
(Although there were/are some very exotic exceptions - but those dont apply here).