0

Hi all,

How to find the free physical memory...
actually i want to avoid the exception from new operator..
i have used the GlobalMemoryStatus a windows api for this
but new is giving exception still more memory available than
i am allocating.

I am using visual studio 2005

Please help me....
Thanks in advance...

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Ancient Dragon
0

It is not entirely clear what problem you are having from your description.

I assume that this is not just a memory leak that has arisen in your code from calling new() without delete.

But from a problem I had recently with new() giving a bad memory alloc exception. I found that visual studio has ~2Gb limit as an application. There are both compiler and OS issues with trying to load very large amounts of memory at once. This also has limits when the memory is being reserved for dynamic memory as it was doubling each time. If you are not using more than 1Gb then I imagine that you have a different problem.

REading very briefly about globalmemorystatus on msdn you are probably going to get an over flow error and so you would need GlobalMemoryStatusEx

Hi all,

How to find the free physical memory...
actually i want to avoid the exception from new operator..
i have used the GlobalMemoryStatus a windows api for this
but new is giving exception still more memory available than
i am allocating.

I am using visual studio 2005

Please help me....
Thanks in advance...

0

I found that visual studio has ~2Gb limit as an application.

That is the limit of all 32-bit compilers, not just visual studio. Install a 64-bit compiler (vs express doesn't support it, so you will have to buy it) on a 64-bit os and the limit will be a lot larger. I think, but not sure, that g++ and gcc will compile 64-bit programs.

Edited by Ancient Dragon: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.