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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -