By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,918 Members | 2,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,918 IT Pros & Developers. It's quick & easy.

Dynamic memory failure reason

P: n/a
What could be the reasons for dynamic memory allocation failure (in
vc++, using new statement) when the memory has more than 1 GB of
unused RAM space?
Regards,
Sanjeev
http://coolcampus.8k.com
Jul 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Sanjeev Kumar wrote:
What could be the reasons for dynamic memory allocation failure (in
vc++, using new statement) when the memory has more than 1 GB of
unused RAM space?


I am afraid that the standard C++ language has not answer to that question.
You will need to ask this in a Windows programming newsgroup. It smells
like you need to set/enable something platform specific.

--
Attila aka WW
Jul 23 '05 #2

P: n/a
Attila Feher wrote:
Sanjeev Kumar wrote:
What could be the reasons for dynamic memory allocation failure (in
vc++, using new statement) when the memory has more than 1 GB of
unused RAM space?

I am afraid that the standard C++ language has not answer to that question.
You will need to ask this in a Windows programming newsgroup. It smells
like you need to set/enable something platform specific.


While it is truly platform-specific, often, and on many platforms,
the failure to allocate a chunk of memory while the OS still reports
some amount free is due to the fragmentation of the memory causing
inability of the execution environment to give you a *contiguous*
piece you're requesting.

V
Jul 23 '05 #3

P: n/a
While it is truly platform-specific, often, and on many platforms,
the failure to allocate a chunk of memory while the OS still reports
some amount free is due to the fragmentation of the memory causing
inability of the execution environment to give you a *contiguous*
piece you're requesting.


That shouldn't be too much of a problem given that the O/S can map free
memory pages however it wants.

Jon
----
Learn to program using Linux assembly language
http://www.cafeshops.com/bartlettpublish.8640017
Jul 23 '05 #4

P: n/a

"Sanjeev Kumar" <sa***********@gmail.com> skrev i en meddelelse
news:74**************************@posting.google.c om...
What could be the reasons for dynamic memory allocation failure (in
vc++, using new statement) when the memory has more than 1 GB of
unused RAM space?
Regards,
Sanjeev
http://coolcampus.8k.com


As Victor said, one reason could be fragmentation. Another reason could be
that you somehow screwed up your memory manager or (os-specific) that your
program was assigned a limit not allowing it to use all memory.

/Peter
Jul 23 '05 #5

P: n/a
Peter Koch Larsen wrote:
As Victor said, one reason could be fragmentation. Another reason could be
that you somehow screwed up your memory manager or (os-specific) that your
program was assigned a limit not allowing it to use all memory.

That reminds me what I had read recently about Win64, that it will
maintain all 32-bit APIs like Win32 for backward compatibility, as is
the case of Win16 today, and each 32-bit application will be assigned 1
GB of maximum memory, while today the maximum memory of such an
application is less (however I do not recall how much and where I read
it - perhaps the current limit is 512 MB).
Perhaps the OP is trying to surpass this memory limit.


--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.