1. <legend id='mZN8c'><style id='mZN8c'><dir id='mZN8c'><q id='mZN8c'></q></dir></style></legend>

    <small id='mZN8c'></small><noframes id='mZN8c'>

    1. <i id='mZN8c'><tr id='mZN8c'><dt id='mZN8c'><q id='mZN8c'><span id='mZN8c'><b id='mZN8c'><form id='mZN8c'><ins id='mZN8c'></ins><ul id='mZN8c'></ul><sub id='mZN8c'></sub></form><legend id='mZN8c'></legend><bdo id='mZN8c'><pre id='mZN8c'><center id='mZN8c'></center></pre></bdo></b><th id='mZN8c'></th></span></q></dt></tr></i><div id='mZN8c'><tfoot id='mZN8c'></tfoot><dl id='mZN8c'><fieldset id='mZN8c'></fieldset></dl></div>
      • <bdo id='mZN8c'></bdo><ul id='mZN8c'></ul>
      <tfoot id='mZN8c'></tfoot>

      程序退出时是否释放了泄漏的内存?

      时间:2023-09-26

      • <bdo id='y74bS'></bdo><ul id='y74bS'></ul>
          • <tfoot id='y74bS'></tfoot>
            • <legend id='y74bS'><style id='y74bS'><dir id='y74bS'><q id='y74bS'></q></dir></style></legend>

              1. <i id='y74bS'><tr id='y74bS'><dt id='y74bS'><q id='y74bS'><span id='y74bS'><b id='y74bS'><form id='y74bS'><ins id='y74bS'></ins><ul id='y74bS'></ul><sub id='y74bS'></sub></form><legend id='y74bS'></legend><bdo id='y74bS'><pre id='y74bS'><center id='y74bS'></center></pre></bdo></b><th id='y74bS'></th></span></q></dt></tr></i><div id='y74bS'><tfoot id='y74bS'></tfoot><dl id='y74bS'><fieldset id='y74bS'></fieldset></dl></div>
                  <tbody id='y74bS'></tbody>

                <small id='y74bS'></small><noframes id='y74bS'>

                本文介绍了程序退出时是否释放了泄漏的内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                如果我在不知情的情况下编写了内存泄漏,然后应用程序终止,泄漏的内存是否被释放?

                If I programmed — without knowing it — a memory leak, and the application terminates, is the leaked memory freed?

                推荐答案

                是的,内存泄漏"只是进程不再引用的内存,因此无法再释放.操作系统仍会跟踪分配给进程的所有内存,并在该进程终止时将其释放.

                Yes, a "memory leak" is simply memory that a process no longer has a reference to, and thus can no longer free. The OS still keeps track of all the memory allocated to a process, and will free it when that process terminates.

                在绝大多数情况下,操作系统会释放内存 - 就像 Windows、Linux、Solaris 等正常风格"的情况一样.但重要的是要注意,在各种实时环境等特殊环境中操作系统程序终止时可能不会释放内存.

                In the vast majority of cases the OS will free the memory - as is the case with normal "flavors" of Windows, Linux, Solaris, etc. However it is important to note that in specialized environments such as various Real-Time Operating Systems the memory may not be freed when the program is terminated.

                这篇关于程序退出时是否释放了泄漏的内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何在 C++ 代码/项目中找到内存泄漏? 下一篇:cpp - valgrind - 读取大小 8 无效

                相关文章

                <legend id='EBzHY'><style id='EBzHY'><dir id='EBzHY'><q id='EBzHY'></q></dir></style></legend>
                  <bdo id='EBzHY'></bdo><ul id='EBzHY'></ul>
              2. <i id='EBzHY'><tr id='EBzHY'><dt id='EBzHY'><q id='EBzHY'><span id='EBzHY'><b id='EBzHY'><form id='EBzHY'><ins id='EBzHY'></ins><ul id='EBzHY'></ul><sub id='EBzHY'></sub></form><legend id='EBzHY'></legend><bdo id='EBzHY'><pre id='EBzHY'><center id='EBzHY'></center></pre></bdo></b><th id='EBzHY'></th></span></q></dt></tr></i><div id='EBzHY'><tfoot id='EBzHY'></tfoot><dl id='EBzHY'><fieldset id='EBzHY'></fieldset></dl></div>

              3. <tfoot id='EBzHY'></tfoot>

                  <small id='EBzHY'></small><noframes id='EBzHY'>