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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:58:03+00:00 2026-06-14T06:58:03+00:00

I’m currently learning about low level arduino stuff including memory. My question is since

  • 0

I’m currently learning about low level arduino stuff including memory. My question is since heap and stack grow at the opposite side of the memory, does out of memory only happens if both meet somewhere in the middle, or does it happen when one of them hit the middle.

  • 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-14T06:58:04+00:00Added an answer on June 14, 2026 at 6:58 am
    • there’s no notion of “middle”
    • depending on how the underlying operating system (if any at all!) manages the processes (if there is such thing on the platform!), the stack may have a limited size, much smaller than “the rest of whole memory”
    • depending on how the underlying operating system (if any at all!) manages the virtual memory space (if there is such thing on the platform!), the heap may have a limited size, much smaller than “the rest of whole memory”

    If any of those limits are in place, then there is a very tiny probability of those regions meeting each other. Actually, most probably they will sooner simply run out of space, and the guarding mechanisms will raise relevant hardware of software exceptions.

    This means that the ‘out of memory’ event is not a one thing. There’s OOM in stack, and OOM in heap. In my parts of world, traditionally, that related to the stack is called StackOverflow 🙂 and the one related to heap is OutOf[Heap]Memory.

    Notably, if your platform has a notion of virtual memory, then the stack most probably is still a singular block of space, but heap – will probably be a sparse construct, and will consist of multiple scattered blocks of space, not necessarily physically ordered in some ascending or descending way. In such case, there’s hard to speak about anything meeting anything. The StackOverflow happens when stack hits the size limit, and OutOfMemory happens when the memory manager cannot find a suitable free hole in the memory space.

    If to ignore virtual memory, and if talking only about ‘raw hardware’, then it depends on .. where the stack is really located. IIRC(!), on some (really old) platforms the stack was preallocated at some predefined space situated at the beginning of the physical memory, let’s say first ten pages, and grew ‘to the bottom’. Then were a few pages of hardware mapped tables and port state images, and then the remaining tail was the heap. With such setup, the StackOverflow is risen when the stack pointer reaches zero. It was quite ‘smart’ because detecting zero is easy with processor’s status flags.. Also, for those old processors it was far easier to reach lower adresses than higher ones, so putting the often-accessed stack in the lower adresses was a big plus.

    IIRC(!), newer platforms do not have those problems (usually, let’s ignore NUMA and similar things), and the current traditional ‘raw hardware’ setup putting special areas (tables, portmaps, etc) at the beginning of space, then Heap, then ‘free area’ then the Stack, and StackOverflow happens when the free area is gone, that is when the stack meets any block already by the heap. Note, that StackOverflow still does not mean OutOfMemory: the stack might have overflown, but the heap may have some gaps and still might have lots of free space!

    Please be aware that those ‘IIRC’s are important. I’m not an expert on Arduino and current processor architectures, and also the ‘historical’ blargh above might be quite off in terms what was newer/older. I give it probability of 80% to be true.

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

Sidebar

Related Questions

I don't have much knowledge about the IPv6 protocol, so sorry if the question
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I am currently running into a problem where an element is coming back from
I need to clean up various Word 'smart' characters in user input, including but
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.