memory program and debug

categories of memory error

  • memory leak
  • memory overflow
  • dangling pointers

how to detect memory error

  • ps -aux, check VSZ, e.g:
    • ps -aux |grep -E 'VSZ|2892.*firefox' |grep -v grep
    • watch -n 5 'ps -aux |grep -E "VSZ|2892.*firefox" |grep -v grep'

static program analysis tools

  • pc-lint
  • spint, a tool for statically checking c programs for
    vulnerabilities and coding mistakes.

detect methods

  • mtrace
  • valgrind

reference