Skip to content
Go to file

Latest commit

Add an install rule; don't override CC and CFLAGS variables

Also, remove spurious GPLv2 license. The code is licensed under
Apache 2.0 (because it's from Android). As regards the Makefiles,
you are free to do with them whatever you want :-)

Git stats


Failed to load latest commit information.

Display true memory usage using procrank

procrank is a tool commonly used by Android platform developers to find out how much memory is really being used. In fact it is so useful that I was surprised to find that versions that run on normal Linux are so conspicuous by their absence. Hence my port to Linux here.

I have tested it so far only on 64-bit x86 and 32-bit ARM, but it should work on any architecture so long as the kernel has pagemap.


For a native build:

$ make

To cross compile:

$ make CROSS_COMPILE=<your cross compile prefix>


Simply run the program (as root):

  PID       Vss      Rss      Pss      Uss  cmdline
 1109    29072K   16388K   11296K    9600K  /usr/bin/python
  584    65160K   10400K    9372K    9096K  /usr/bin/node
                           ------   ------  ------
                           78433K   65556K  TOTAL

RAM: 509016K total, 346780K free, 14616K buffers, 70652K cached,
1468K shmem, 14580K slab

Run "./procranc -h" to see the help screen for more options.


If you are intereted in the background, I have written a blog post on smaps and Pss at

Where the source files came from

This version is from Android Lollipop, which I chose in order to have support for 64-bit kernels as well as 32-bit.

The source for procrank is from $AOSP/system/extras/procrank

I had to edit procrank.c and add

#include <signal.h>

The source for libpagemap is from $AOSP/system/extras/libpagemap

And the source for strlcpy is from $AOSP/bionic/libc/upstream-openbsd/lib/libc/string/strlcpy.c libpagemap


procrank from Android ported to (embedded) Linux




No releases published


No packages published
You can’t perform that action at this time.