Skip to content

Instantly share code, notes, and snippets.

View EricRahm's full-sized avatar

Eric Rahm EricRahm

View GitHub Profile
@EricRahm
EricRahm / gist:a5b96df4583a163bf809
Last active August 29, 2015 14:16
On device memory profiling

Figuring out available memory on a device

adb shell cat /proc/meminfo

  • MemTotal tells you how much device memory is available outside of drivers/kernel.
  • MemFree tells you how much memory is currently available, checking this after booting should give you a rough guesstimate of what our max is.

To simulate what would happen in a low-memory situation you can adb shell kill <pid> each b2g process but b2g, (Nuwa), Homescreen (use b2g-ps to get a b2g process listing). Unfortunately Homescreen just comes back (it can be LMK'd though, so add it's USS to the MemFree total to get a better idea of an ideal MemFree value).

Get an overview of b2g application memory usage

@EricRahm
EricRahm / about_memory_parser.py
Created January 29, 2015 23:00
about memory parser
import json
import collections
import sys
import operator
from pprint import pprint
def path_total(data, path):
totals = collections.defaultdict(int)
totals_heap = collections.defaultdict(int)