473,395 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Memory usage limits

When I create an char array with more than approx 1,000,000 elements, I seem to run up against a stack overflow problem. I'm assuming that WinXP is only assigning a small amount of memory for this process. How do I get around this issue and increase the array size to one I'll need (approx 10,000,000 elements)?
Nov 16 '05 #1
1 1349

"Jeff Laidlaw" <an*******@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
When I create an char array with more than approx 1,000,000 elements, I

seem to run up against a stack overflow problem. I'm assuming that WinXP is
only assigning a small amount of memory for this process. How do I get
around this issue and increase the array size to one I'll need (approx
10,000,000 elements)?

Allocate your array on the heap (with new or malloc) instead of the stack.
Consider using std::vector.

By default, your threads get only 1 or 2Mb of stack space. You can increase
the stack size using the linker /STACKSIZE: option, but you're better off
just getting such large arrays off the stack.

-cd
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Zac | last post by:
I've been googling all day and I haven't seen anyone else having this problem, so I thought I'd check to see if I'm unique or I should be expecting this behavior. I've recompiled and reinstalled...
1
by: Bob Kochem | last post by:
Can someone point me at a tutorial or other reference on how VB 5 &/or 6 consumes memory and what its limits are? I have a program in VB5 that has been around a while and grown quite a bit. I...
2
by: David Miller | last post by:
Hello, I posted this to DotNet.Framework.Controls a week ago or so and got no response, so now I will repost it here to see if anyone here knows anything about it... I have an application...
4
by: Frank Esser | last post by:
I am using SQL 8 Personal edition with sp2 applied. I set the max server memory to 32MB and leave the min server memory at 0. When my application starts hitting the database hard the memory usage...
20
by: iouswuoibev | last post by:
When writing a function that manipulates data (for example, a string), is it in principle a good or bad idea to allocate/deallocate memory within that function? For example, I have the following...
4
by: AN | last post by:
Greetings, We make an ASP.NET web application and we host it for our customers. We have provisioned hardware and hope to be able to service around 200 customers on this hardware. The web...
94
by: smnoff | last post by:
I have searched the internet for malloc and dynamic malloc; however, I still don't know or readily see what is general way to allocate memory to char * variable that I want to assign the substring...
49
by: vfunc | last post by:
If I have a large array 10,000+ elements then how do I reserve memory for this ? Currently I get a segmentation fault. Dynamic reservation is good, but allowing a chunk for the program is an...
1
by: Jean-Paul Calderone | last post by:
On Tue, 22 Apr 2008 14:54:37 -0700 (PDT), yzghan@gmail.com wrote: The test doesn't demonstrate any leaks. It does demonstrate that memory usage can remain at or near peak memory usage even after...
12
by: bomahony | last post by:
Im runnign various versions of DB2 on various UNIX platforms (Solaris / AIX). DB2 is generally eating up about 30% of memory on these systems (4Gb of RAM, which equates to over a gig). i want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.