Jak sprawdzić ilość pamięci zużywana przez program?
Może to być jakaś funkcja STL'a lub jakieś rozwiązanie Linuksowe.
do jakiego systemu to potrzebujesz? pod Linuxa czy pod windows, bo to są dwie rózne metody, w skrajnym przypadku w linuxie moana parsować komendę ps -e ;). Ale na powaćnie to powiedz pod jaki system to potrzebujesz to postaram się pomódz
marcin007 napisał(a)
...Może to być jakaś funkcja STL'a ...
ta biblioteka jest do czego innego... chyba, że o czymś nie wiem?
dla Windows znalazłem cosik takiego, może się przyda http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/base/collecting_memory_usage_information_for_a_process.asp
Najlepsze rozwiazanie dla Linuksa:
Odczytać zawartość pliku
/proc/PID/statm
A jesli program ma pobierac o sobie, to:
/proc/self/statm
jakiś manual napisał(a)
statm ? A status of the memory in use by the process. Sample statm files look like this:
140 72 63 22 0 50 22
The seven columns relate to different memory statistics for the process. In order of how they are displayed, from right to left, they report different aspects of the memory used:
Total program size, in kilobytes
Size of memory portions, in kilobytes
Number of pages that are shared
Number of pages are code
Number of pages of data/stack
Number of pages of library
Number of dirty pages