Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 769415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:19:53+00:00 2026-05-14T18:19:53+00:00

I was going through one of the threads. A program crashed because it had

  • 0

I was going through one of the threads.
A program crashed because
it had declared an array of 10^6 locally inside a function.

Reason being given was memory allocation failure on stack leads to crash.

when same array was declared globally, it worked well.(memory on heap saved it).

Now for the moment, let us suppose,
stack grows downward and heap upwards.

We have:

—STACK—

——————-

—HEAP—-

Now , I believe that if there is failure in allocation on stack,
it must fail on heap too.

So my question is: is there any limit on stack size?
(crossing the limit caused the program to crash).
Or am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:19:54+00:00Added an answer on May 14, 2026 at 6:19 pm

    This all depends on what language and compiler you use. But programs compiled with for instance C or C++ allocate a fixed size stack at program startup. The size of the stack can usually be specified at compile time (on my particular compiler it default to 1 MB).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 538k
  • Answers 538k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer A portable threadpool library that claims to be 'production ready'.… May 17, 2026 at 1:52 am
  • Editorial Team
    Editorial Team added an answer To expand on Jerry's comment: // base.h enum BaseCodes {… May 17, 2026 at 1:52 am
  • Editorial Team
    Editorial Team added an answer Use .live() when adding controls dynamically, like this: $("input[name='songs']").live("change", function()… May 17, 2026 at 1:52 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm going through a lot of files and on each file I need to
Simple enough question, I just need to break through one minimal wall of confusion.
I have a property declared as the following: @property(assign) BOOL die; One thread continuously
I'm going through Structure and Interpretation of Computer Programs and I'm having a bit
I'm going through the full tutorial at cplusplus.com, coding and compiling each example manually.
I'm going through the problems in the Haskell O'Reilly book. The problem I am
Similar questions have been asked before but after a day of going through the
I'm starting to learn ASP.NET and going through the tutorial videos on www.asp.net .
I'm thinking about starting a new project using EF 4 and going through some
Background I have a Spring batch program that reads a file (example file I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.