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 8163661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:06:50+00:00 2026-06-06T19:06:50+00:00

Does it always happen that stack always grows downwards & heap grows upwards? If

  • 0

Does it always happen that stack always grows downwards & heap grows upwards?
If its so, then how does OS keeps the heap area protected from the interference of the stack & vice-versa?
If its not, then what factors affect it? OS version ? Compiler? Anything else??

  • 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-06-06T19:06:52+00:00Added an answer on June 6, 2026 at 7:06 pm

    Yes this is usually the case. The implementation details of this is managed by the OS and varies widely. To make a very simple example, assume that the stack starts on a higher address in memory compared to the heap which starts on a lower address. If you keep track of the top of the heap and the top of the stack and you put more data on the heap and more data on the stack they will eventually meet somewhere inbetween because as you said the stack grows downwards and the heap upwards. When this occurs the memory is out so all you need to keep track of is when these two have collided.

    Now for a real operating system this is often not this simple because each process has it’s own stack and some have their own heap and we are maybe working on virtual memory addresses where the actual physical placement could be anywhere. You can assume that each heap and stack is given an address and a limit which form the boundries of the maxiumum amount of memory each process can utilize. If this limit is reached the OS need to tell the process either that it is out of memory or try to find more memory to allocate for the out of memory process.

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

Sidebar

Related Questions

This does not always happen, but sometimes when I try to build a (large)
Does fgets() always terminate the char buffer with \0 even if EOF is already
Why does Thunderbird always return immediately after sending mail through MAPI? Other clients, like
The following code does not always create the file. As far as I noticed,
I found out jQuery does not always create the correct DOM from an HTML
When running commands from a bash script, does bash always wait for the previous
I wonder, using Eclipse's PyDev plugin , how come documentation does not always show
Does this code always evaluate to false? Both variables are two's complement signed ints.
Why does this code always return 0? var possibleMatches = new Array(); $.getJSON('getInformation.php', function(data)
Does anybody know why my getAltitude in the following always returns 0? package com.example.helloandroid;

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.