Hot answers tagged

2

A simple way would be to use GNU time command. /usr/bin/time python test.py /usr/bin/time /bin/sh -c 'ghc -o test test.hs; ./test' /usr/bin/time /bin/sh -c 'gcc -o test test.c; ./test' To normalize for starting the shell, I would also add a /bin/sh -c to the python command. time has many options for formatting the output and including memory, I/O and ...


2

What the system will do with the remaining 20%? The kernel will use the remaining physical memory for its own purposes (internal structures, tables, buffers, caches, whatever). The memory overcommitment setting handle userland application virtual memory reservations, the kernel doesn't use virtual memory but physical one. Why is this parameter required ...


1

To get an idea of why your process dies, make its parent process print the exit status. The exit status indicates whether the program due to a signal and includes an 8-bit exit code from the process. The 8-bit exit code is conventionally 0 for success and 1..125 to indicate an error. In a C/Perl/… program, you can query the whole exit status. Consult the ...


1

You can easily read the stack of another process using the proc file system (You will need root access for this). Before arbitrarily reading from the /proc/pid/mem you need to consult the /proc/pid/maps. A simple read in this file shows a lot of entries. We are interested in the entry marked as stack. Once you get this you need to read the lower and upper ...



Only top voted, non community-wiki answers of a minimum length are eligible