Differences

This shows you the differences between two versions of the page.

Link to this comparison view

shell [2016/12/21 17:08]
dblume [Measuring Available Memory]
shell [2018/09/04 12:54] (current)
dblume [Application Memory Usage]
Line 113: Line 113:
 ((VERBOSE==1)) && echo "Starting at $(date)" ((VERBOSE==1)) && echo "Starting at $(date)"
 rsync /cygdrive/c/Users/me /cygdrive/"$DISK"/backup/Users rsync /cygdrive/c/Users/me /cygdrive/"$DISK"/backup/Users
 +
 +# We add "|| true" because we don't want to stop 
 +# if the directory was already empty
 +rm -r /cygdrive/c/Users/me/tmp/* || true
 +
 +# Note how we find the number of cores to use
 +make -C build_subdirectory all -j$(grep -c ^processor /proc/cpuinfo)
 </code> </code>
  
Line 380: Line 387:
 done done
 </code> </code>
 +Alternatively, to see the RSS use of that process alone: 
 +<code bash> 
 +while true; do sync; cat /proc/$(pidof yourprocess)/status | grep VmRSS; sleep 1; done 
 +</code>
 ====== Measuring Available Memory ====== ====== Measuring Available Memory ======
  
Line 437: Line 447:
          # ... commands executed under lock ...          # ... commands executed under lock ...
     ) 9>/var/lock/mylockfile     ) 9>/var/lock/mylockfile
 +
 +
 +====== Retrieving Symbols with addr2line ======
 +
 +You can gather a backtrace (stacktrace) with this piped command to addr2line.
 +
 +    $ cat << EOF | cut -d " " -f 3 | tr -d "[]" | \
 +      addr2line -e builds/austin/src/platform/gibbon/netflix | \
 +      xargs -d '\n' realpath --relative-to=.
 +    > 7/22 app() [0xf7878] (0xf7878)
 +    > 8/22 app() [0x39c2f8] (0x39c2f8)
 +    > 9/22 app() [0xe1964] (0xe1964)
 +    > EOF
 +    src/Application.h:106 (discriminator 3)
 +    src/platform/main.cpp:521
 +    src/Application.cpp:95
 +    
 +====== Sort by Frequency ======
 +
 +I ran the following P4 command to find out who's been editing a file recently:
 +
 +    $ find . -name fname.cpp | xargs p4 filelog -s -m 10 | grep -P "^\.\.\. #" | \
 +      awk '{print $9}' | cut -d @ -f 1 | sort | uniq -c | sort -nr
 ====== Additional Keywords ====== ====== Additional Keywords ======
  
 Linux, Unix, *nix Linux, Unix, *nix
shell.1482368896.txt.gz · Last modified: 2016/12/21 17:08 by dblume
 
Recent changes RSS feed Driven by DokuWiki