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

  • Home
  • SEARCH
  • 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 6611545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:59:00+00:00 2026-05-25T19:59:00+00:00

When a C++ program terminates, the RAM used during the run gets cleaned and

  • 0

When a C++ program terminates, the RAM used during the run gets cleaned and is returned to the system, correct?

Question 1)
Is this memory returned managed by C++ language features or by the computer hardware itself?

Question 2)
Does the memory get returned efficiently/safely, if I terminate a run using ctrl+Z in Unix terminal?

  • 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-25T19:59:01+00:00Added an answer on May 25, 2026 at 7:59 pm

    When a C++ program terminates, the RAM used during the run gets cleaned and is returned to the system, correct?

    Correct. By System, I hope you mean, Operating System.

    Question 1) Is this memory returned managed by C++ language features or by the computer hardware itself?

    The returned memory is managed by the operating system (if I correctly understand the question). And before returning to the OS, the memory is managed by the process; in low-level, which means, managed by various language features, such as allocation- deallocation mechanism, constructors, destructors, RAII, etc.

    Question 2) Does the memory get returned efficiently/safely, if I terminate a run using ctrl+Z in Unix terminal?

    Ctrl+Z suspends the process. It doesn’t terminate it. So the memory doesn’t get returned to the OS as long as the process is not terminated.

    In linux, Ctrl+C terminates the process, then the memory returns to the OS.

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

Sidebar

Related Questions

The following program terminates correctly: import System.Random randomList = mapM (\_->getStdRandom (randomR (0, 50000::Int)))
Sometimes (about 1 out of 100 runs), my program terminates with this message: terminate
I am programming in C++ on Linux platform. My program terminates with this (unhandled???)
What's the best way to terminate a program and then run additional code from
Strange program hang, what does this mean in debug? After attaching windbg I found
I have a NSMutableArray that I create on program load. If the program terminates,
Basically, on surfaces that are going to exist right until the program terminates, do
My program (a text-mode web browser) is dynamically allocating memory. I do free unneeded
I am trying to understand the practical difference during the execution of a program
My program terminates for some reason. Its a rock-paper-scisors simulation. The termination takes place

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.