O Blog do Gustavo Felisberto

Paulo Sacramento More on the previous post Print This Post Print This Post
 

(if you don’t have technical background, it might be better to skip this - I’m sorry to have to stress this)

First things first, after using the strategy (am I really using this word? Isn’t workaround much more accurate) Gustavo mentioned, I managed to reduce my Firefox footprint to only (am I really using this word?) 150 Mb. I’m currently using 2 windows and a total of 6 tabs. Two major things have happened after I changed the browser.sessionhistory.max_total_viewers parameter:

1 - Both “Mem Usage” and “VM Size” went drastically down (to about a half).
2 - “VM Size” approached “Mem Usage” while previously it was much bigger.

1 allows us to reach the La Palisse conclusion that if you disable Firefox’s Back-Forward caching you save memory. It also suggests that this Back-Forward cache works in a very weird way that makes it use much more memory than you would expect.
2 suggests that Firefox does leak a lot of memory if you leave it on for days (which I do regularly). Why? To answer this we need really to look deep into the subject.

This is what I think of it all:

Firefox uses something they call a Back-Forward cache. This means that a number of pages you have seen are kept at hand when you “leave” them in order to speed up successive accesses made particularly by using the “Back” and “Forward” browser buttons (by the way, what does it mean to you to “leave” a webpage? Closing it? Stop looking at it? Remember that an HTTP request is episodic -> you send it, the server sends you the document, end of story. The rest is up to the browser.).

It is important to notice that this cache is not per-tab (see the final Edit in this post).

According to the same source, the Firefox configuration parameter browser.sessionhistory.max_total_viewers is defaulted to “-1″, which instructs it to use a sensible table associating Total RAM Size with the Number Of Pages cached by this feature. This table is so sensible that if you happen to have only 32Mb of RAM, it causes 0 pages to be cached. Sensible indeed. This number grows as your RAM grows, quite sensibly, until you get to those lucky guys who have 1Gb and more of RAM. Those guys get to have 8 pages cached. For 1Gb+, Mozilla apparently thought that 8 was good enough and nobody would be interested in caching more than 8 pages anyway…

In my case, I have 512Mb of RAM, I get 5 cached pages. If you recall, this is not per-tab, which means that I can have 100 tabs and I only get 5 cached pages (this is perfectly fine, any other way would probably yield catastrophe). This also means that in theory I can leave Firefox on for a month, use it intensively, and I will never have more than 5 cached pages. Fine. And 5 pages is usually absolutely nothing in terms of occupied memory. At this point, I would like to say that claiming that this “feature” has anything to do with a big footprint largely puzzles me. If it works as it’s explained in the above source, I don’t understand how one thing influences the other to such a huge extent.

But I’m getting away from my goal. Why is it then that the fact that “VM Size” approaches “Mem Usage” if you disable this Back-Forward cache suggests that Firefox does leak a lot of memory if you leave it on for days.

What are “VM Size” and “Mem Usage”? In this context, they are designations created by Microsoft in its “Windows Task Manager”. A bit loosely, but trusting the Task Manager help, it seems that “Mem Usage” represents the amount of RAM currently occupied by the process. As you should know from Operating Systems 101, Computer Architecture 101 and such other wonderful subjects, this is NOT the actual size of the process - how big it is - because some of it will usually be resting on your hard drive because your OS noticed that you hadn’t used some parts of it for a while. Your process is split, some parts in central memory, others in secondary memory. “VM Size”, meaning Virtual Memory Size, I trust, gives us the actual size of the process, how big it is. And the problem, recall, is that my Firefox instance is currently occupying more than 160 Mb of my RAM, i.e., has a “VM Size” of 160 Mb.

One of the consequences of this is that if you don’t use a program for a while but still keep it running, “Mem Usage” will go down while “VM Size” will usually stay more or less where it was. How much “Mem Usage” goes down depends on what is considered “necessary” to be in memory for a given process at a given time.

The fact that “Mem Usage” and “VM Size” are similar can mean one of two things:

- that the process is currently being used
- that the OS isn’t being able to identify pieces of the program that are suitable to be written out of memory and to disk

(to be continued…)

Paulo Sacramento Huge Firefox memory leaks Print This Post Print This Post
 

The screenshot pretty much says it all:

Firefox footprint

200+ Mb just for what’s in central memory and a total of 300+ Mb sounds like a “bit” too much for me. Even if you read lousy excuses like this, I don’t think this can be called quality software.

(I have 3 windows and a total of 5 tabs open but this firefox instance has been running for several days)

Gustavo Felisberto …… Print This Post Print This Post
 

Ontem foi dia 26 de Março. Ontem foi dia de aniversário para muita gente por esse mundo fora. Mas em especial foi dia de aniversário de uma pessoa muito especial na minha vida.

Tentei todo o fim de semana pensar em algo para aqui escrever. Mas não conseguia encontrar um conjunto de palavras que fossem exprimir como deve ser as sensações que me passavam pela cabeça e pelo coração.

Raquel: O amor que temos partilhado continua a crescer de dia para dia. Este fim de semana partilhámos tanto de nós que posso dizer sem medos e sem receios de estar enganado que daqui a muitos anos vamos olhar para este dia e sentir que foi ontem…..

E para terminar:

Gustavo Felisberto Bugzilla and UTF-8 Print This Post Print This Post
 

I have a bugzilla instalation that uses a Postgres backend. The database is using unicode, so all hell went loose when users entered characters like “á à ã” because bugzilla was assuming ISO and not UTF.

I did some changes to the Gentoo ebuild to install the 2.22rc1 bugzilla. This release seems very stable and the setup screens much more organized. That is the way to go Mozilla gang.

If any one wants the ebuild drop a note here.

Gustavo Felisberto Gentoo developers World Map Print This Post Print This Post
 

In the last two days I’ve been playing with xplanet to make some maps with all the Gentoo developers.
The result can be found on my dev page. The images will be updated as the info used to create them is updated. For background i used an image from the Nasa earth observatory.
If you want to play here is what i used

  1. xplanet  -config ./default -geometry 1280×640 -window -pango -fontsize 9 -output dev-map.png -num_times 1 -projection rectangular
  2. xplanet  -config ./default -geometry 1280×640 -window -pango -fontsize 9 -output dev-euro-map.png -num_times 1 -latitude 55 -longitude 15 -fov 0,2
  3. xplanet  -config ./default -geometry 1280×640 -window -pango -fontsize 9 -output dev-na-map.png -num_times 1 -latitude 40 -longitude -95 -fov 0,2

The default file is a modified xplanet config file, you can download mine.

Paulo Sacramento Crash (2004) Print This Post Print This Post
 

(Note: this was written yesterday night and I was completely unaware that IT WAS Oscar night. Serendipity… I left the text unaltered. I’m glad for the outcome: 3 awards including Best Picture and Best Original Screenplay)

Yesterday I finally saw the, by now famous, 2004 movie by Paul Haggis, Crash.
There’s no mistaking it as one of the best movies of this young century and I’ll be secretly pushing for it on Oscar night.

Counting on a vast and competent cast, Crash reminds us at times of P. T. Andersson’s Magnolia albeit profiting a lot on the shorter duration and the popularity, universality and reality of its central theme: racism.

Through the eyes of several different characters living their daily routines in modern Los Angeles, the viewer is constantly confronted with examples of intolerance. Haggis opts for a magnificent approach at times showing us the pitfalls of intolerance and at times the immense advantages of rennouncing it.

Crash should not be confused with other more naive movies about the subject. Especially because it contains a delightful detail, which is the altruistic and brutally realistic idea of the pervasiness of racism and intolerance and what I like to term as the “wholeness of human character”, that is, the conclusion that no human being is only “good” or only “bad”, this meaning actually that “good” people, or people as so perceived, will end up doing very “bad” deeds and “bad” people, or people as so perceived, will end up saving the day.

In the end, Crash is thus also a movie about the randomness of life and human deeds. What Kundera would call The Lightness Of Being.

Tagline: “You think you know who you are. You have no idea.”

Paulo Sacramento Como diria o Loureiro, suuuuuuuuuuuuuuuuuuuiiiiitttt Print This Post Print This Post
 

Tinha uma nomenclatura ranhosa nuns ficheiros que têm uma data no nome o que provocava uma grande confusão em termos de ordenamento. Abri a consola e voilá :)

  1. import os
  2.  
  3. for file in os.listdir("."):
  4.    if file.startswith("report"):
  5.       if not file[7].isdigit():
  6.          os.rename(file,"report0"+file[8:])
  7.  
  8. for file in os.listdir("."):
  9.    if file.startswith("report"):
  10.       os.rename(file,"report"+file[11:13]+file[8:11]+file[6:8]+
  11. file[13:])

P.S.: Eu até indentava isto em condições mas a maneira como o Wordpress trata (ou não trata) os espaços em branco é odiosa. Detesto este editor… Chamar a isto WYSIWYG é brincadeira certamente. Quando muito é WYSIWWW - What you see is what we want ou WYSIWYGBPDUWS - What you see is what you get, but please don’t use white spaces. O mais correcto mesmo é WYSIWYGBOAYCTSBAWTIWBDFWYWS - what you see is what you get but only after you click the Save button, at which time it will become different from what you were seeing