Solved

Unable to allocate more than 600 MB of ram

Posted on 2009-03-29
3
601 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
I have purchased two new systems and both are now Universal Extensible Firmware Interface (UEFI) based. UEFI is replacing BIOS for the desktop PC. It is a Linux based firmware with enough robustness it can communicate with a website without loading …
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

734 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