Solved

Unable to allocate more than 600 MB of ram

Posted on 2009-03-29
3
598 Views
Last Modified: 2013-11-10
I am running into one hell of a weird memory problem...

A DLL library containing mixed managed and unmanaged C++ code is trying to allocate several large arrays of memory (around 160 MB X 4). The system currently has more than 2 GB of free memory so obviously it's not a true out of memory problem. The code that requires the memory is unmanaged. A managed C# program uses the DLL library. I tested the program immediatly after Windows started so this could not possibly be a memory fragmentation problem.

I tried using VirtualAlloc(), HeapAlloc(), GlobalAlloc(). All failed at exactly 600 MB. I tried creating a new private heap using CreateHeap() to overcome what appears to be an artificial limit but that did not work. I even tried using the page file directly using CreateFileMapping() to no avail.

Using 64bit operating systems to overcome the 2GB per process limit is not an option.

What to do? #_#
0
Comment
Question by:Ameerh24
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 16

Expert Comment

by:warturtle
ID: 24012510
Try to disable any antivirus software and try again. Secondly, try to disable Data Execution Prevention and re-execute the code again.
0
 

Author Comment

by:Ameerh24
ID: 24013467
I don't think this has anything to do with the Antivirus or DEP as I am neither executing code from memory nor am I having any buffer overflows. The problem is in allocation. Using the new keyword returns std:bad_alloc and malloc returns NULL. For the sake of testing I disabled both but that did not help.
0
 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24016964
Is it possible for you to show a small example the way (one of the ways) you try to allocate memory? I have a 4GB system here, also 32 bit, Vista, and I may have the same results, in which case I can copy your situation.

Btw, iyou do say you use managed and unmanaged together. Sounds somehow that you bumped into the maximum memory size allowed by the CLR. From my memory, I think that should be unlimited (set in machine.config) but maybe it is set to a maximum?
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: When experiencing some peculiar problem with the functioning of your PC, how many times has it happened that you look for a solution and even google can’t help? It could be that you are one of the only few people on earth who ma…
Great sound, comfort and fit, excellent build quality, versatility, compatibility. These are just some of the many reasons for choosing a headset from Sennheiser.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question