Firefox memory print going crazy

I'm a firefox user. I use it extensively.

Since Ajax gained popularity and more and more sites getting "ajaxed" my firefox is getting slower and slower. I sometimes don't kill the process for days and open and close numerous windows with numerous tabs. I even have a bookmark folder called "Open these" and in there are links to my web mail sites, web rss reader, web calendar...

So, anyway, firefox starts taking more and more memory and the thing I noticed is that when I kill the process and then start it again and reopen everything I had opened just before killing it it takes few times less memory.

Before: a whopping 676 MB of memory.

After: just 240 MB

(Screenshots from Process Explorer an excellent (now Microsoft) tool from sysinternals)

So I don't know if the difference is some caching or just memory leaks, but 670 MB for a browser with 5 windows and total of 9 tabs (one window was just empty) is too much.

And I wouldn't make it that much of a big deal, but recently it started lagging and taking up to 50% of my processor - I don't like it. The machine on which the screenshots were taken is a Pentium 4 3.2Ghz, 2GB memory (hp workstation).

On my laptop (Core 2 Duo 1.67Ghz, 2GB memory) it's not lagging yet, but I expect it to. And then I'll look for an alternative.