Re: Measuring memory footprint in C/C++ code on FreeBSD

2011-10-23 Thread Razmig K
Hello Thanks to everyone for tips and insight you gave me on this discussion. ~Razmig ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to

Re: Measuring memory footprint in C/C++ code on FreeBSD

2011-10-21 Thread Razmig K
Le 20.10.2011 19:57, Razmig K a écrit : the memory footprint in C/C++ code for a program running under FreeBSD and Linux in terms of total process size including heap objects Well getrusage does actually exist in Linux, but its behaviour isn't the same as on FreeBSD; struct rusage memory

Re: Measuring memory footprint in C/C++ code on FreeBSD

2011-10-21 Thread Razmig K
Le 21.10.2011 10:44, Peter Jeremy a écrit : On 2011-Oct-20 19:57:31 +0200, Razmig Kstrontiu...@gmail.com wrote: It's not clear whether the program is attempting to determine it's own (or a child's) memory footprint, or that of an arbitrary process. In the former case, getrusage() is the obvious

Re: Measuring memory footprint in C/C++ code on FreeBSD

2011-10-21 Thread Ivan Voras
On 21/10/2011 12:19, Razmig K wrote: Le 21.10.2011 10:44, Peter Jeremy a écrit : On 2011-Oct-20 19:57:31 +0200, Razmig Kstrontiu...@gmail.com wrote: It's not clear whether the program is attempting to determine it's own (or a child's) memory footprint, or that of an arbitrary process. In the

Re: Measuring memory footprint in C/C++ code on FreeBSD

2011-10-21 Thread Razmig K
Le 21.10.2011 12:26, Ivan Voras a écrit : Well, do you know that SIZE in top is virtual memory size, not resident size (which is the RES column)? You can allocate whatever you want from virtual memory, it is not used until it's touched. Yes, I do. So do you suggest using RES as a better

Re: Measuring memory footprint in C/C++ code on FreeBSD

2011-10-21 Thread Peter Jeremy
On 2011-Oct-20 19:57:31 +0200, Razmig K strontiu...@gmail.com wrote: I'd like to measure the memory footprint in C/C++ code for a program running under FreeBSD and Linux in terms of total process size including heap objects. Due to execution length, I'd like to avoid the use of valgrind.

Re: Measuring memory footprint in C/C++ code on FreeBSD

2011-10-21 Thread Ivan Voras
On 21/10/2011 12:57, Razmig K wrote: Le 21.10.2011 12:26, Ivan Voras a écrit : Well, do you know that SIZE in top is virtual memory size, not resident size (which is the RES column)? You can allocate whatever you want from virtual memory, it is not used until it's touched. Yes, I do. So do

Re: Measuring memory footprint in C/C++ code on FreeBSD

2011-10-21 Thread Wojciech Puchar
footprint? Almost certainly yes. Measuring virtual memory is significantly less important for real-world loads. Some of this is very nicely described here: https://www.varnish-cache.org/trac/wiki/ArchitectNotes . definitely. just run top and compare RES and SIZE fields. extreme example:

Re: Measuring memory footprint in C/C++ code on FreeBSD

2011-10-21 Thread Dan Nelson
In the last episode (Oct 21), Razmig K said: Le 21.10.2011 10:44, Peter Jeremy a écrit : On 2011-Oct-20 19:57:31 +0200, Razmig Kstrontiu...@gmail.com wrote: It's not clear whether the program is attempting to determine it's own (or a child's) memory footprint, or that of an arbitrary

Measuring memory footprint in C/C++ code on FreeBSD

2011-10-20 Thread Razmig K
Hello I'd like to measure the memory footprint in C/C++ code for a program running under FreeBSD and Linux in terms of total process size including heap objects. Due to execution length, I'd like to avoid the use of valgrind. I think that it would be difficult to achieve the task

Re: Measuring memory footprint in C/C++ code on FreeBSD

2011-10-20 Thread Daniel O'Connor
On 21/10/2011, at 4:27, Razmig K wrote: I think that it would be difficult to achieve the task in a platform-transparent manner, that's why I'll be using /proc/pid/status on Linux, and do something else on FreeBSD. I was adviced to have a look on getrusage, which I did, but I found