Posts tagged with memory

A tiny portion of Doug Hofstadter’s “semantic network”.
via jewcrew728, structure of entropy


How the Mozilla developers fixed Firefox’s memory problem.

I use Ubuntu (+lxde+awesomewm) and have always defaulted to Chromium because that was the fastest, sexiest browser when I started. All of the clean defaults of Safari, fast, and $GOOG gets to learn more about me every time I type anything anywhere. Um. Well, it had a sexy reputation.

I installed the following extensions:

  • FlashBlock
  • Youtube options
  • Vimium
  • TabCloud
  • TooManyTabs
  • Lazarus Form Recovery (the only way I know of to prevent losing tumblr posts you were writing during a crash)
  • Mailto:Gmail
  • Minus
  • Personal Blocklist (I like to punish spam sites)
  • Readability
  • PageRank

But at least for me, now, the way I browse and with my OS, Firefox is working beautifully and Chromium starts kicking its life out around 25+ tabs.


Let me postface this by explaining how I use web browsers, and OS’s in general. I load them up with TONS of stuff. Having 9 desktops full of PDF’s and tabs is normal for me.

I usually dedicate 30% of my desktops to work projects (KTimeTracker automatically measures when I’m actually looking at the work desktop in question), 30% to “read later” stuff — a maths desktop, a CS desktop, a statistics desktop — and the remainder to either articles browsing (politics/economics/news of the weird) or a movie I’m going to watch later. I usually have 100-200 tabs open and maybe 10-20 PDF’s or ebooks, as well as whatever terminals, tmux pseudo-ttys, and VT’s I’m running. (Oh, I run a VT for mutt and a VT for TTYtter.)

This adds up to a lot of programs running at once, all taking up RAM. Not good but that’s the way I roll. Open webpages and open PDF’s are my to-do list — just like books from the library sitting in a stack are a to-do list. The greatest OS improvement for me has been finding dphys-swapfile, a program that increases the size of my swapfile whenever I push the boundary. Right now I have 11 GB of swap and growing every few days.

As it was I used chrome://kill, TabCloud / TooManyTabs / Readability → Kindle to reduce Chromium’s memory usage and spent X hours per week closing windows that I wasn’t reeeeellyyy going to get to within the next few days. Found out you can launch chromium from the CLI with chromium-browse —purge-memory-button —process-per-site & to reduce the load from multiple instances of Gmail or Facebook. Then click Shift+Esc or (wrench) > Tools > ... and you get a Purge Memory button which supposedly reduces Chromium’s memory footprint. (There are design concerns that would prevent the developers fro mautomatically “hitting the purge memory button” every few seconds, which you can see in the slides above)

In browser design as in calculus: You can’t optimise for everything at once. Chrome, whilst a slick browser with a lot of nice defaults, optimises for hardware and usage that don’t describe my browsing habits. Now you’ve seen the load I encumber my computer with; Firefox 12 now seems to be the best browser for my usage type. Maybe you can call us “heavy drag” users or “zillion tab” users.


  • rats’ brains, and presumably ours, tessellate the plane surface we walk on with multiple overlapping triangular grids
  • (is there a mathematical reason triangles are optimal? euler characteristic, perhaps?)
  • path" neurons in the hippocampus fire as we cross these grids to reconstruct our previous paths
  • boundary" neurons in the hippocampus fire as we approach the boundaries of a space
  • (what about agoramaniacs? or ancient people who hunted buffalo on the plain?)

Peter Todd has been misquoted about the mathematics of dating here, here, here (here), here, here, here, herehere, here, here, and in at least five trillion issues of Cosmo. (Surprisingly, this and this did not misquote him.) It’s enough to make me want to write a strongly worded DEAR SIR to the Hearst Tower.

Here is what they say:

  • Only after you’ve dated twelve people, are you ready to decide who’s “The One”!

An even wronger version of the story goes like this:

  • The twelfth guy you date — he’s The One! Science says so! No pressure!!!!!!!

Not only is this wrong, but I’ve heard Peter rant in person, specifically about these misquotations. The problem he studies is known colloquially as "The Search for a Parking Space”.

  1. When you arrive at the movie theatre, you circle around the car park until you see an opening. (Let’s assume it’s below freezing outside.)
  2. When you see that opening, you can immediately tell how far away it is from the theatre. So you know how far you will have to walk in the cold.
  3. At that moment, you have to decide whether to drive on (keep looking for somewhere closer) or accept the probably-imperfect husband — oops, I mean parking space — that you’re staring straight in the face (oops, I mean tarmac).
  4. You can’t back up; you can’t see ahead; all you can do is remember the past, guess about the future, and assess the situation you’re in. That’s all you’ve got to go on. Try to solve that problem optimally.

The paper that’s being referenced (though apparently not read) in these magazines deals with an even stricter problem, known as "The Vizier Wants to Keep His Head":

  1. In this version of the blind forward-search problem, the greedy, vindictive, lazy Prince has to choose a wife.
  2. Being lazy, he tasks the Vizier with solving his problem. Being vindictive, if the Vizier gets it wrong, the Vizier loses his head. Being greedy, the Prince wants the Vizier to find him the wife with the richest dowry.

    (I believe dowry is chosen because it’s seen as a one-dimensional, objectively valuable quantity — as opposed to beauty, which is multifaceted and arguable. If we’re talking about various land holdings, I think dowry would also be multifaceted; that things have a single price is an illusion <link> of simplistic economic thinking.

    Imagine a woman whose family had holdings in modern-day Lebrija, Huelva, Palma del Condado, Aracena, and Ayamonte. Each taxable area will bring in unpredictable revenues year upon year, and the natural beauty of each estate is just as disputatious as a woman’s face. So how is that a one-dimensional value? Oh, well. The point is to assign a scalar to each woman.)

  3. The debutantes enter the Prince’s chamber one at a time; as each enters, a courtier reads her name and family holdings. So the Prince and Vizier assign a scalar to that maiden. Then the Prince either proposes marriage or declines.

  4.  Once an heiress has been declined, the Prince can’t call her back. In other words, even if he thinks to himself: “Crap! B_tch Number 37 had a nice rack and a fabulous estate in Milano. I should have gone with her!”, that’s just too bad. Even a handsome, powerful, jerk of a Prince can’t un-dump a ladyfriend.

  5. So the Vizier is set up a similar, but more constrained, problem to the Car Park Dilemma. Except the Prince can’t circle around the way a driver could.

  6. Also, this is important: exactly one-hundred dames will appear before the prince. The solution changes if an infinite progression of dames (or even just all the singles in your greater metropolitan region of choice) paraded before him.

  7. If a richer girl is to be found among either the post-wife sequence of the pre-wife sequence of heiresses, off with the Vizier’s head. 

Given that problem: pick the highest scalar from a forward-blind, one-by-one sequence of scalars, the Vizier maximises his probability of living past the ritual (to something like 30%) with the following strategy:

  1. Observe the wealth / beauty / scalar value of the first 12 women.
  2. Whatever is the highest wealth / beauty / scalar out of that group, becomes your “aspiration level” A.
  3. As soon as you see an heiress with wealth/beauty/scalar ≥A, tell the Prince to marry her.

Again, that strategy doesn’t make the Vizier win (i.e., it doesn’t make you pick the perfect boyfriend every time); it merely maximises the chances of maximisation, within this narrowly specified problem.

So here are the reasons the magazines & blogs are wrong:

  • A boyfriend is not a scalar.
  • Who says that a date equals a sample? I’ve been getting to know the human race my whole life. Every day I spend single, married, or it’s complicated — I am learning more information that can be used to set my aspiration level for a partner.
  • You can go back sometimes — either to rekindle a relationship that, in retrospect, was red-hot, or to revisit a crush you didn’t get far enough with to make things awkward.
  • There aren’t just 100 boys to look through. Let’s face it, there might as well be an infinite number of fish in the sea.
  • Um: a boyfriend is not a scalar. Love depends on you as well; if you could reduce your feelings to a scalar, you’d still want to model the relationship as a 2-equation dynamical system. Interplay; choices; reactions.


The original paper is called “Satisficing in Mate Search”. (I couldn’t find it online). Here is much, much more material on both data on dating and the science of thinking smarter by Dr. Todd.

You can also read Simple Heuristics That Make Us Smart (it’s on my to-read list — and it contains “Satisficing in Mate Search”), and if you look at Amazon’s similar books for the title you’ll come across all kinds of fascinating stuff: about Bayes’ rule, thinking from the gut, less is more, why it’s good to be stupid, willpower, and even an intro to game theory. (I haven’t read that particular treatment, but I do recommend reading just-a-little-bit of game theory as an awesome way to expand your imagination.)

You can get instant gratification with a free chapter of each, so these popular treatments are just as candy-like as Wired or Cosmo.


Just like with modern physics, this modern psychological science is super interesting. Way too interesting to justify wasting time on false and farcical narratives that totally miss the point.

To gild refined gold, to paint the lily, to throw perfume on a violet, … is wasteful and ridiculous excess. —King John