get total and free memory in c++ -
does c++ have method in java
runtime.getruntime().totalmemory() runtime.getruntime().freememory()
i using in way
long mem0 = runtime.getruntime().totalmemory() - runtime.getruntime().freememory(); /* stuff */ long mem1 = runtime.getruntime().totalmemory() - runtime.getruntime().freememory(); system.out.println(mem1-mem0);
to find memory used program. here analogues in c++?
its not specified in c++ standard, under windows need use winapi for example this , under linux need use library or call syscalls.
Comments
Post a Comment