恰好那个程序结束后没有释放的内存是什么? [英] What happens to memory that is not freed after end of program?

查看:118
本文介绍了恰好那个程序结束后没有释放的内存是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

复制:<一href=\"http://stackoverflow.com/questions/654754/what-really-happens-when-you-dont-free-after-malloc\">What如果你不这样做的malloc后免费真正发生?

比方说,例如:

int main()
{
  char* test = new char[50000];
  return 0;
}

该程序已完成后发生了分配的内存呢?是否得到立即释放其他应用程序?或许一段时间后?或者,也许它是输给了系统永远不会消失?抑或是被换到磁盘再也没有回到内存?或者,也许完全不同的东西?

What happens to the allocated memory after the program had finished? Does it get freed for other applications immediately? Or perhaps after some time? Or maybe it's lost to the system forever? Or does it get swapped to the disk never to return to RAM? Or maybe something completely different?

我想知道的3大操作系统的会发生什么:的Windows(XP及以上,如果有任何差异),在Linux,Mac OS X

I would like to know what happens on the major 3 OS's: Windows (XP and up, if there are any differences), Linux, Mac OS X.

推荐答案

请参阅:<一href=\"http://stackoverflow.com/questions/654754/what-really-happens-when-you-dont-free-after-malloc\">http://stackoverflow.com/questions/654754/what-really-happens-when-you-dont-free-after-malloc

这篇关于恰好那个程序结束后没有释放的内存是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆