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
Solved

Unable to allocate more than 600 MB of ram

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Studio 2013 and Eclipse Neon 6 49
Determine exact dimensions of screen 5 61
IIS on Server 2012 R2 Datacenter 5 54
Uniden UDW20055 3 30
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

829 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