Click here to Skip to main content
15,944,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello together,

I'm programming in VS 2012 an application that needs the maximum of memory. My System has 16 GB RAM and the OS is Win 7 profesional 64 bit. After enabling the Large Address Aware flag my appliaction stops at 3 GB.
Is their a easy way to get more then 3 GB without doing PAE and AWE?

thanks for the help
Sergey Alexandrovich Kryukov 16-Jul-14 11:05am    
This 3GB limit is only for 32-bit systems. Are you sure you really use a 64-bit system (not only CPU)? What is the instruction-set architecture your application target? 3.5G maybe too much for 32-bit, because the whole address space is 4G.
Member 10414137 16-Jul-14 11:11am    
I have to compile my application in 32 bit because of this I also have the 4G limit 2^32. I hoped that I can get the 4 G in total, because I don't need the 1G for the Kernel -> 64 bit System. But I don't find a easy way to do it till now.
Sergey Alexandrovich Kryukov 16-Jul-14 11:37am    
There is no an easy way except switching to some 64-bit targets. Please see my answer.

1 solution

The 3G limit is totally irrelevant to 64-bit OS. Just forget it. Youe real limit is 4G address space for a 32-bit process. You did not provide enough information if first place, but here are my conclusions:

You are really hitting the 4G limit. You just inaccurately estimated your maximum memory use as 3.5G. It could be just you major data, but the environment (WoW64) and your application take up some more. The fact is: 3.5G is way too close to the address space limit. Here is what you can do:

  1. Consider reviewing your application architecture. Many overuse memory due to architectural mistakes. Often, the application don't need as many objects loaded in memory at the same time. You can store some objects on disk, re-created some, and so on.
  2. Alternatively, switch to one or two of the 64-bit instruction-set architectures: x86-64, IE64 (Itanium), whatever you want to target.
  3. …Or combine both approaches.

Remember: there is no such thing as miracle. You certainly need to use one or another approach, not a magical system trick; you don't have any.

See also:[^],[^],[^],[^],[^],[^].

Good luck,
Share this answer
Member 10414137 17-Jul-14 3:31am    
It seems to be like that - I hit the 4G limit. I think my memory is too much defragmented to give me again a 100 KB space. I thought the garbage collector will do a better job. If I ask for smaller packets I receive them. In the last try my application was 3.28 GB - readed out of the ressourcemonitor of windows so their should be everything included, don't you think?

At the moment I'm working with an i7 prozessor, but I can't change that.

The problem is that I grabbing very fast camera pictures. So I don't have the time to save it to hard disc or I need to buy a ssd disk. Also I will need a thread on his one kernel to do this. So I hoped their is an easier way.

do you have further more conclusions.
Sergey Alexandrovich Kryukov 17-Jul-14 12:52pm    
Thank you for this important feedback.

Garbage collector does just the perfect job. It is based on the concept of unreachable object. If some memory is not reclaimed, you have to blame yourself, not GC.

You even could create memory leaks by architectural mistakes. You can hold some references to some object which you don't use anymore, but it would hold GC. Read about WeakReference, it will give you some idea (even if you won't actually use them; you probably don't have to).

So, my advice: a) first of all, review your application architecture to avoid memory leaks and reduce the usage of objects which you don't have to keep in memory, even if you are going to migrate to one or more of 64-bit architectures; b) do all it takes to migrate to 64 bits, especially if the changes on item #1 are not so dramatic. By they way, are there any specific hassle in migrating to 64-bit architectures?

That's all you can do. Now, are you going to accept my answer formally (green "Accept" button)? In all cases, your follow-up questions will be quite welcome. I do understand that your situation might be pretty difficult, so you need to weight all what can be relevant.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900