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

How to increase HEAP size in VC++ 6.0 environment

P: n/a
Hi All

My program needs a lot of memory and after allocating some using NEW
statement, it returns NULL for any new object created. I guess that is
becuase of the heap size limitation of the Visual Studio which stands
at 1MB. I need to increase it. One option I found was to set
/HEAP:memory in the Link options of project setting. Bur it didn't
seem to work. I am getting same problem again.
Dows anybody has a opinion about this.

regards
Nikhil
Jul 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Nikhil,

Look at the Win32 API calls VirtualAlloc() and VirtualFree(). Use these
instead of new/delete for large blocks of memory.

On a side note, this forum is suppose to be c++ only --- not OS dependent
or compiler dependent.

Anyway, I hope those two API calls will help you. ;-)

Perry

"nvjoglekar" <nv********@rediffmail.com> wrote in message
news:bc**************************@posting.google.c om...
Hi All

My program needs a lot of memory and after allocating some using NEW
statement, it returns NULL for any new object created. I guess that is
becuase of the heap size limitation of the Visual Studio which stands
at 1MB. I need to increase it. One option I found was to set
/HEAP:memory in the Link options of project setting. Bur it didn't
seem to work. I am getting same problem again.
Dows anybody has a opinion about this.

regards
Nikhil

Jul 22 '05 #2

P: n/a
nvjoglekar <nv********@rediffmail.com> spoke thus:
My program needs a lot of memory and after allocating some using NEW
statement, it returns NULL for any new object created. I guess that is
becuase of the heap size limitation of the Visual Studio which stands
at 1MB. I need to increase it. One option I found was to set
/HEAP:memory in the Link options of project setting. Bur it didn't
seem to work. I am getting same problem again.
Dows anybody has a opinion about this.


If you do indeed require a larger heap, you must seek help elsewhere.

http://www.slack.net/~shiva/welcome.txt
http://www.parashift.com/c++-faq-lite/

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 22 '05 #3

P: n/a
"nvjoglekar" <nv********@rediffmail.com> wrote in message
news:bc**************************@posting.google.c om
Hi All

My program needs a lot of memory and after allocating some using NEW
statement, it returns NULL for any new object created. I guess that is
becuase of the heap size limitation of the Visual Studio which stands
at 1MB. I need to increase it. One option I found was to set
/HEAP:memory in the Link options of project setting. Bur it didn't
seem to work. I am getting same problem again.
Dows anybody has a opinion about this.

regards
Nikhil


VC++ specific questions are off-topic here. You should post them at

microsoft.public.vc.language

I rather doubt, however, that your problem is really a VC++ configuration
problem. Two points:

1. The 1Mb default heap size is just an initial value. The heap is enlarged
as needed (as a test, I just allocated 100Mb without a problem in spite of
using the default heap settings).

2. NEW is not part of the C++ language. The appropriate keyword is new
(lower case).

I suspect that your problem is a language one, but it is impossible to be
more specific without seeing your code. See if you can create a compileable
sample that exhibits the problem. Of course, the amount of memory available
on any system is limited, so it is possible to exceed it. But a normal
correctly written program is unlikely to do so.
--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)

Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.