Re: Memory allocation




"Kellie Fitton" <KELLIEFITTON@xxxxxxxxx> wrote in message
news:1189706964.308818.42130@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Sep 13, 9:00 am, "Andrew Jarvis" <someone@somewhere> wrote:
Dear All,

I have I C++ COM DLL for performing computed tomography which until now
has
been able to allocate memory up to the 2Gb limit with no problems.

Now I am finding that I get an out of memory error if I try to allocate
more
than 250Mb.

GlobalMemoryStatusEx shows 1.7Gb available physical RAM.

I have tried VirtualAlloc, GlobalAlloc and HeapAlloc with the same
result.

A VB6 test program allocates 1439Mb using GlobalAlloc. (VirtualAlloc does
not work at all - I've no idea why)

What could possibly be introducing this limitation?
I have upgraded from VS6 to VS2005 for writing the DLLs but I can't see
how
that could be responsible. The main process is the same VB6 application.

Regards,
Andrew


Hi,

Try to use the following APIs to get some clues on how much actual
memory, the virtual memory manager wants you to use within your
application program:

GetProcessWorkingSetSizeEx()

SetProcessWorkingSetSizeEx()

http://msdn2.microsoft.com/en-us/library/ms683227.aspx

http://msdn2.microsoft.com/en-us/library/ms686237.aspx

Kellie.



When I include a call to GetProcessWorkingSetSizeEx I can no longer load my
DLL because it introduces a dependency to dwmapi.dll. I understand that this
is a Vista DLL that does not exist in Windows XP.

Could this be related to my original problem?


.



Relevant Pages

  • Re: Memory Management
    ... include the memory manager after any files that declare malloc etc. I'm not ... I have tried to export the operators from a DLL, ... I'm still using the CRT's malloc and free to allocate memory. ...
    (microsoft.public.vc.language)
  • Re: VirtualAlloc()
    ... large/global memory usage instead of "new". ... allocate physical storage. ... uses `VirtualAlloc'. ...
    (microsoft.public.vc.language)
  • Re: Using TLSAlloc to read data into a DLL
    ... and store that data in a memory block that is untouched until the ... DLL is unloaded. ... simply allocate a block of memory in DllMainand ... CreateFile et al are in the kernel. ...
    (microsoft.public.vc.language)
  • Re: Free memory allocated by dll
    ... method to allocate the memory. ... If the author actually used memory that was allocated on the stack, ... Having spoken to the dll author the dll just creates a ... I use this as a string - however when done I believe that i need to ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Games made with BBC BASIC for Windows
    ... Memory handling, string handling and data structures are part of BBC ... allocate 256 Mbytes of contiguous virtual address space (actual memory ... used is of course typically very much less) but for some reason Wine ... options of VirtualAlloc, presumably because of some limitation in ...
    (comp.sys.acorn.misc)

Loading