开两三个还可以 :D
接着,执行一次malloc需要很久
接着,某一次,我黑屏了。机器彻底没响应。
我绝望的按Alt+F4、Ctrl+Alt+Del,等了几分钟后。桌面又显示出来了
我赶紧把剩下的窗口关掉。
据说,在有的系统上,malloc并不真的分配物理内存,而只是分配地址空间。只有
在该页面第一次被引用的时候才会真的分配。而free从来都不释放物理内存,只有
当系统内存不够用的时候才释放。
看来win不是如此。
p.s.不能拿malloc来测试。因为debug版的malloc可能会做特殊填充。这个操作将
会导致页面被引用。得拿系统具体的API做测试。
附系统日志如下:
Warning 2009/11/1 2:09:11 Diagnostics-Performance 500 Desktop Window
Manager Monitoring
The Desktop Window Manager is experiencing heavy resource contention.
Scenario : The Desktop Window Manager responsiveness has degraded.
Warning 2009/11/1 2:09:11 Diagnostics-Performance 501 Desktop Window
Manager Monitoring
The Desktop Window Manager is experiencing heavy resource contention.
Reason : CPU resources are over-utilized.
Diagnosis : A consistent degradation in frame rate for the Desktop
Window Manager was observed over a period of time.