473,804 Members | 3,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to increase HEAP size in VC++ 6.0 environment

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
3 7198
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********@red iffmail.com> wrote in message
news:bc******** *************** ***@posting.goo gle.com...
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
nvjoglekar <nv********@red iffmail.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)cybers pace.org | don't, I need to know. Flames welcome.
Jul 22 '05 #3
"nvjoglekar " <nv********@red iffmail.com> wrote in message
news:bc******** *************** ***@posting.goo gle.com
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.publi c.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
30102
by: Kevin Grigorenko | last post by:
Hello, I couldn't find an obvious answer to this in the FAQ. My basic question, is: Is there any difference in allocating on the heap versus the stack? If heap or stack implementation is not part of the standard, then just disregard this question. Here's some questions I'm confused about, and if you can add anything else, please do so! Is the stack limited for each program?
3
495
by: nvjoglekar | last post by:
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.
1
1635
by: Stefan | last post by:
Hi, My file size has gone from 32kb to 100kb, and I was wondering if using the 'new' and 'delete' keywords were responsible. I heard that if you use them the linker has to include extra routines in the program to make them work; a heap manager. Is this true? I am using Visual C++ ..NET 2003 by the way.
1
8234
by: nrhayyal | last post by:
hi all, i am working on C++ on AIX machine. i am running one of my module which is built using 10+ user built libraries. i am getting St9bad_alloc exception. i came to know that this exception is thrown because the heap is exhausted. when i checked while running the program , i found that the program uses 128 MB of heap after which it waits , then it throws this exception.
3
5193
by: gary | last post by:
Hi, 1. About all C/C++ compilers, Does stack increase from high address to low address and heap grow increase from low to high? What on earth decides their increase direction, CPU architecture, OS or compiler? 2. In GNU gcc, { int a = {0, 1, 2, 3, 4}; bool b; float c; for (int i = 0; i < 5; i++) {
2
6646
by: Ralf Gross | last post by:
Hi, I have an java application that throws the following exceptions. COM.ibm.db2.jdbc.DB2Exception -- COM.ibm.db2.jdbc.DB2Exception: SQL0973N Not enough storage is available in the "UDF_MEM" heap to process the statement. SQLSTATE=57011 COM.ibm.db2.jdbc.DB2Exception -- COM.ibm.db2.jdbc.DB2Exception: SQL0954C Not enough storage is available
5
4026
by: Olaf Gschweng | last post by:
We're new into DB2 and have some problem with DB2 8.1 (?) on a Linux system. We load some big tables of a DB2 database from files every day. We do a "DELETE FROM table" for each table and then we load the data by something like that: LOAD FROM "/pathto/artikel.data" OF DEL MODIFIED BY DATESISO CHARDEL0xbf SAVECOUNT 50000 MESSAGES "/pathto/artikel.msg" INSERT INTO artikel;
9
7331
by: Ajay | last post by:
Hi all, Can I know what is the stack space and heap space allocated by the compiler.Can i increase it or decrease it.if yes,pleae tell me theway to do it.Thanks in advance. Cheers, Ajay
11
5221
by: Andy Watson | last post by:
I have an application that scans and processes a bunch of text files. The content I'm pulling out and holding in memory is at least 200MB. I'd love to be able to tell the CPython virtual machine that I need a heap of, say 300MB up front rather than have it grow as needed. I've had a scan through the archives of comp.lang.python and the python docs but cannot find a way to do this. Is this possible to configure the PVM this way? ...
5
24831
by: kumarmdb2 | last post by:
Hi guys, For last few days we are getting out of private memory error. We have a development environment. We tried to figure out the problem but we believe that it might be related to the OS (I am new to Windows so not sure). We are currently bouncing the instance to overcome this error. This generally happen at the end of business day only (So maybe memory might be getting used up?). We have already increased the statement heap & ...
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10567
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10074
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9138
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7613
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.