Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More than 4GB for a single application?

Status
Not open for further replies.

Insider1984

Technical User
Feb 15, 2002
132
0
0
US
Hi there. We are in Visual Studio 6.0 with C++ code.

We have a need for a single application to use more than 4GB of system memory.

I know the long term best method is to separate interests and isolate the portions of the code into separate processes but the short term need is to have a single process using up to 16GB of memory (32-bit available).

I'm familiar with the 3GB and PAE switch. I also have the LARGEADDRESSING flag set in the application and it is currently using > 2GB in a 4GB system.

What can I do to "seemlessly" enable > 4GB for a single application?

=====================
Insider
4 year 'on the fly' programmer
C, C++, C#, MFC, Basic, Java ASP.NET
 
That's not possible on a 32 bit system. The absolute limit of 32 bit addressing is 4GB, but in practice it is often reduced to 2 or 3GB to accomodate the OS's code, dlls and wahtnot. You need to have 6a 4 bit system, running in a 64 bit OS, and use a 64 bit compiler to address more memory. Or you might be able to hack together a home-made swap file or something, but good luck with that!
 
It is actually possible using Intel's extended addressing system. Most Pentiums are capable of doing this. It is the same old story: just because Microsoft hasn't released an OS which can do it, everyone thinks it is not possible.

In the days of the 286, MS only used the flat addressing mode so the 286 could only handle 1Mb but if they had used the extended addressing mode, it could have handled 16Mb.

4Gb is the limit on flat 32bit addressing. The limit on extended addressing is 64Tb. You can do whatever you want if you are running in your own OS. The problem is the effort required to handle it and the segmented addressing and all the problems it brings.

The other alternative as VincentP mentioned is 64bits. You have a choice of OSs: Linux, Solaris 10, HPUX, Windows Vista to name a few. Note: 64bit Vista is still in beta and VS6.0 cannot handle 64 bit compilation. You have to move to VS2005 if you want to use 64bits. You may be able to load a 16Gb program then.

VS6 may or may not be able to handle large files either. I've had problems with VS2002 on large files. Just simple things like performing a stat ends up with negative numbers or the incorrect size because the filesize cannot handle anything larger than 4Gb. Also fseek cannot seek past 4Gb so you certainly will have problems. On VS2003 and VS2005, the position is 64bits so it can handle the larger sizes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top