The Linux distillery
Bringing the world of Linux to you, David cuts through the tech and shows you how it works and how to use it, in terms that apply to any distro. RSS
Technology news and Jobs arrow The Linux distillery arrow Make Firefox fly: building from a minefield of source
Make Firefox fly: building from a minefield of source E-mail
by David M Williams   
Monday, 30 June 2008
So! How big is this running Firefox, then? It's time to find out. Let's probe a little by running some commands.

We know the process ID of the Firefox browser I launched is 4939, that's the number that I was given back by bash when I started it up, as above.

[david@dmw firefox-3.0]$ ls -s firefox
48 firefox
[david@dmw firefox-3.0]$ ps -lmp 4939
F S UID PID  PPID C PRI NI ADDR SZ    WCHAN  TTY   TIME     CMD
0 - 500 4939 4205 0 -   0  -    43297 -      pts/1 00:00:02 firefox
0 S 500 -    -    0 80  0  -    -     sys_po -     00:00:02 -
1 S 500 -    -    - 80  0  -    -     futex_ -     00:00:00 -
1 S 500 -    -    - 80  0  -    -     futex_ -     00:00:00 -
1 S 500 -    -    - 80  0  -    -     futex_ -     00:00:00 -
1 S 500 -    -    - 80  0  -    -     futex_ -     00:00:00 -


This information tells us the following.

  • The file 'firefox' takes up 48 disk blocks.
  • The firefox command has process ID 4939, which we knew, and was launched by parent process 4205, which is my bash shell.
  • It has also started up five threads.
  • Four of these threads were started up via the fork system call. None of them use super-user privileges. This is what the 1 in the F (flags) column means.
  • The threads are all in interruptible speed. They are waiting for something to happen, namely, for me to click the mouse or use the keyboard. This is what the S in the S (state) column means.
  • The CPU utilisation is presently 0%. This is the 0 in the C (CPU) column.
  • The process priority is 80, and we haven't elected to raise or decrease the effective priority. This is the 80 in the PRI (priority) and the 0 in the NI (nice) column respectively.
  • The total size in physical pages of the process core image - including all text, data and stack space - is 43,297 pages. This is the SZ column and is a meaningful item.
  • The threads are sleeping in two different kernel functions; these are the values in the WCHAN column. The - in the first row means the main firefox command itself was running at that instant (which is why its state was not also S.)
  • The command was launched from the first terminal on my system, as indicated by the TTY column.
  • The accumulated CPU time is 2 milliseconds, as indicated by the TIME column.

If you switch back to Firefox and begin loading web pages, performing activity as usual, and re-run the ps command periodically you will find the CPU utilisation and accumulated CPU time going up. Depending on what you do and what else is running the priority may also fluctuate.

Let's now experiment with building it ourself. You can download the Firefox source code from Mozilla's FTP site. At the time of writing, the last modified version was 17-June-2008 9:35am and was 36,144KB in size.

CONTINUED



 
< Next story in category   Previous story in the category >
iTWire user statistics Visitors last 30 days
Suscribers
904,266
13,751
#1 independent technology news advertise here
  •   *  
  • Search
  • AdvSeach
  • Login
  • Events
  • FreeStuff
Subscribe to our free e-newsletter