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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:47:24+00:00 2026-05-18T09:47:24+00:00

please bear with me as I am not good at framing question. and upto

  • 0

please bear with me as I am not good at framing question. and upto best of my knowledge this is not repeated question. and for sure this is not home work.

When we call fork, a thread is created, which shares the heap memory with the parent process. what will happen if I overlay this thread’s address space with a different process image (using exec)

1) each segment will be overwritten by corresponding segment of the new process or Is it like, full virtual address space will be overwritten by new process’s full address space ?

2) extra heap memory would be assigned by OS for this new process ? & heap (shared before) will no more be accessible to new process ?

3) all this confusion is because I don’t know whether executable (ready to load) has heap segments or not.

  • 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-18T09:47:25+00:00Added an answer on May 18, 2026 at 9:47 am

    Fork creates memory that is marked as copy on write, so that the processes cannot affect each other through this path.

    Exec releases access to the shared memory, leaving it to the other process. It then allocates entirely new memory for the new process image.

    It’s actually more complicated than this, to maintain open file descriptors and the like but this is a useful approximation.

    EDIT: I think what you want to know on the 3rd point is: The new process is initialized with a new empty heap area. But it probably has some allocations performed by the runtime library prior to main() being called.

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

Sidebar

Related Questions

Not sure how best to word this, so please bear with me. My table
Now, I'm not sure whether this is a stupid question, please bear with me
This is not really a programming question but please bear with me as I
This is not a really Programming Question, but please bear with me as it's
This is not a traditional scale-up or scale-out question. Please bear with me, here
Not sure if I'm asking the right question so please bear with me! Bit
Please bear with me if this question isn't well formulated. Not knowing is part
I am not totally sure I am naming this right, but please bear with
This question is a bit long, please bear with me. In REST, i think
I'm not quite sure of the terminology here so please bear with me.... Let's

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.