Skip to content

Instantly share code, notes, and snippets.

@sdstrowes
Created June 19, 2014 04:10
Show Gist options
  • Save sdstrowes/366bd80e27aa77b871e0 to your computer and use it in GitHub Desktop.
Save sdstrowes/366bd80e27aa77b871e0 to your computer and use it in GitHub Desktop.
valgrind on awk
sds@uist:/tmp$ valgrind --tool=massif --pages-as-heap=yes --massif-out-file=massif.out awk '!x[$0]++' blah.txt > /tmp/foo
==2388== Massif, a heap profiler
==2388== Copyright (C) 2003-2012, and GNU GPL'd, by Nicholas Nethercote
==2388== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==2388== Command: awk !x[$0]++ blah.txt
==2388==
==2388==
sds@uist:/tmp$ ms_print massif.out | head -30
--------------------------------------------------------------------------------
Command: awk !x[$0]++ blah.txt
Massif arguments: --pages-as-heap=yes --massif-out-file=massif.out
ms_print arguments: massif.out
--------------------------------------------------------------------------------
MB
54.26^ :::::::::::::::::::::::::::::
| @::
| ::::@:: #
| ::::: :@:: #
| ::::::: :@:: #
| :@@:::::::: :@:: #
| ::::@ :::::::: :@:: #
| :::::::@ :::::::: :@:: #
| ::::: ::::@ :::::::: :@:: #
| ::@::::: ::::@ :::::::: :@:: #
| :::@::@::::: ::::@ :::::::: :@:: #
| :::: @::@::::: ::::@ :::::::: :@:: #
| ::@:::: @::@::::: ::::@ :::::::: :@:: #
| @::::@:::: @::@::::: ::::@ :::::::: :@:: #
|:::@::::@:::: @::@::::: ::::@ :::::::: :@:: #
|:::@::::@:::: @::@::::: ::::@ :::::::: :@:: #
|@::@::::@:::: @::@::::: ::::@ :::::::: :@:: #
|@::@::::@:::: @::@::::: ::::@ :::::::: :@:: #
|@::@::::@:::: @::@::::: ::::@ :::::::: :@:: #
|@::@::::@:::: @::@::::: ::::@ :::::::: :@:: #
0 +----------------------------------------------------------------------->Mi
0 789.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment