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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:46:41+00:00 2026-06-08T04:46:41+00:00

The virtual address space of a process begins with the text , data and

  • 0

The virtual address space of a process begins with the text, data and bss segments of the process. After this heap allocations are placed, thus heap grows towards larger memory addresses. However, before using a portion of the heap a memory block has to be allocated (valloc and the like) otherwise a segfault occurs (or should occur).

The stack grows from an initial large address in virtual address space toward smaller values. As far as I know this works without virtual memory allocation. How is it possible to use the stack without prior memory allocation when in the case of the heap this is not possible? (Its the same linear virtual address space.)

As far a i know alloca is implemented just as sub esp, <size>. But the region of virtual address space the stack is using must have been allocated somehow prior to this, right?

  • 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-08T04:46:44+00:00Added an answer on June 8, 2026 at 4:46 am

    It does segfault, in some way. This is kind of “lazy” optimization. Operating systems cheat as much as they can, as long as the difference is not externally observable.

    However, the trap does not result in generating a signal (which by default kills the process) as with a normal segfault. Instead, the operating system verifies that the allowable thread size has not been exceeded, and then pulls a new page from the zero pool.

    Under Windows, that mechanism is fancily named “guard page”, I am not aware of a similar naming under Linux. Either way, a guard page is technically nothing but a write-protected page (or a non-existing page) which is remembered by the OS as being “special”, so some particular action can occur when it’s touched.

    This is very similar to how dynamic allocation (malloc, which calls sbrk) works, too. When you allocate memory, not much really happens as long as you don’t access the allocated memory. The only thing that happens is that the OS “remembers” that you grew the data segment.
    If now a fault happens, the OS will create the page, or pull it from the zero pool respectively, and pretend it has been there all the time. You never know it wasn’t there before.

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

Sidebar

Related Questions

http://linux.die.net/man/2/mlockall mlockall () locks all of the calling process's virtual address space into RAM,
From my understanding by reading several articles I assumed Process Address Space(PAS) and Virtual
This image gives a good picture about Virtual Address space. But it only says
What is the limitation on the virtual address space available to a process ?
The user virtual address space for x86-64 with Linux is 47 bit long. Which
in Operating System User mode application's virtual address space is private, one application cannot
Processor physical address lines, Memory bus width, virtual address space, amount of RAM can
I am confused over what is meant by virtual address space. In a 32
I want to create thread or process that would have its own virtual address
I have this virtual method: const string& my_class::to_string() const { string str(this->name + string(

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.