Skip to content

Instantly share code, notes, and snippets.

@yitsushi
Created July 2, 2011 16:32
Show Gist options
  • Save yitsushi/1061111 to your computer and use it in GitHub Desktop.
Save yitsushi/1061111 to your computer and use it in GitHub Desktop.
Memory usage of Browsers
Scripts:
--------
ps aux | grep -i firefox | awk '{sum += $4} END {print 4*1024 * (sum/100)}'
ps aux | grep -i safari | awk '{sum += $4} END {print 4*1024 * (sum/100)}'
ps aux | grep -i chrome | awk '{sum += $4} END {print 4*1024 * (sum/100)}'
Time-Table:
-----------
Name Mega
-------------------------------------------
6:09 PM
Firefox start: 155.648
Chrome start: 360.448
Safari start 73.728
6:11 PM (open lacyc3.eu)
Firefox: 188.416
Chrome: 421.888
Safari: 135.168
6:15 PM (open erolove.hu)
Firefox: 212.992
Chrome: 479.232
Safari: 192.512
6:16 PM (open G + search "lofasz")
Firefox: 241.664
Chrome: 516.096
Safari: 208.896
6:22 PM (open && kill rosszjatekok)
Firefox: 395.872
Chrome: 581.632
Safari: 350.56
6:25 PM (close all tab && wait 2 seconds)
Firefox: 360.448
Chrome: 438.272
Safari: 180.08
Time-Line:
----------
Firefox: 156 -> 188 -> 213 -> 242 -> 395 -> 360
Chrome: 360 -> 422 -> 479 -> 516 -> 582 -> 438
Safari: 74 -> 135 -> 193 -> 209 -> 351 -> 180
date
echo -en "Safari: "
ps aux | grep -i safari | awk '{sum += $4} END {print 4*1024 * (sum/100)}'
echo -en "Firefox: "
ps aux | grep -i firefox | awk '{sum += $4} END {print 4*1024 * (sum/100)}'
echo -en "Chrome: "
ps aux | grep -i chrome | awk '{sum += $4} END {print 4*1024 * (sum/100)}'
@yitsushi
Copy link
Author

yitsushi commented Jul 2, 2011

There are not exact values cos:

  • In safari i was loggen in to google but in firefox and chrome i was not.
  • grep returns sometimes with itself in the list too.
  • values calculated from percentage (it's not exact).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment