在项目中对程序性能优化时,发现用SetProcessWorkingSetSize() 方法使内存降低了很多,于是查阅了相关的资料如下: 我的程序为什么能够将占用的内存移至虚拟内存呢? 其实,你也可以,试试看把一个程序最小化到任务栏,再看看任务管理器。看到没,你的程序占用的实际内存一下子减少了,看来并 Read More
posted @ 2018-04-07 07:16 findumars Views(508) Comments(0) Diggs(0)
1、获取系统内存信息有2个api,分别是GlobalMemoryStatus和GlobalMemoryStatusEx。GlobalMemoryStatus函数可以在C语言里直接调用,但是GlobalMemoryStatusEx却不可以直接调用。 2、看看这2个函数的不同,总的来说这2个函数都可以获 Read More
posted @ 2018-04-07 07:08 findumars Views(782) Comments(0) Diggs(0)
平时我们在写代码时候,有思考过要主动去释放vector的内存吗? 1、对于数据量不大的vector,没有必要自己主动释放vector,一切都交给操作系统。 2、但是对于大量数据的vector,在vector里面的数据被删除后,主动去释放vector的内存就变得很有必要了! 读者可以新建一个控制台程序 Read More
posted @ 2018-04-07 07:07 findumars Views(11752) Comments(0) Diggs(1)
使用diskpart命令Win+R键运行cmd,进入命令行界面:1、diskpart2、list disk 查看有几块硬盘3、select disk 0 选择第一块硬盘4、detail disk 显示选择的硬盘详细信息(显示的第一行是硬盘型号,第二行ID是序列号。) 5、若有多块硬盘,返回第3步继续 Read More
posted @ 2018-04-07 07:05 findumars Views(11374) Comments(0) Diggs(0)
函数原型: int _access( const char *path, int mode ); int _waccess( const wchar_t *path, int mode ); 示例代码: [cpp] view plain copy #include <io.h> #include < Read More
posted @ 2018-04-07 07:04 findumars Views(411) Comments(0) Diggs(0)