Friday, June 12, 2009

Summer

Here comes summer, a season of departures, when the Welly lads are setting out for Hong Kong and New York; and a start of adventures, when two dear friends have just got married and are leaving Beijing for the South. Wish you all good luck!

Monday, May 04, 2009

Congrats to Zhenyu

... who has successfully and completely turned into a family man!

It seems that everyone is getting married in 2009...

Sunday, March 01, 2009

maxrss

The ru_maxrss field in struct rusage provides a convenient way to measure peak memory usage of a program (via getrusage, wait4, or simply `/usr/bin/time -p') on BSD systems, including Mac OS X. According the man page, ru_maxrss represents `the maximum resident set size utilized (in kilobytes)'.

Let's try it on Mac OS X (Leopard, 10.5.6).
$ /usr/bin/time -l uname -v
Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
0.00 real 0.00 user 0.00 sys
385024 maximum resident set size
...

Do you really think the simple `uname' could take 385,024 KB (376 MB) memory ? It also reports 282624 maxrss for a small C program that only contains an empty main and is compiled by `gcc -O2'.

Here is a comparison.

FreeBSD 7.1, kern_clock.c
 527 rss = pgtok(vmspace_resident_count(vm));
528 if (ru->ru_maxrss < rss)
529 ru->ru_maxrss = rss;
Note pgtok is often defined as follows.
#define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024))

Mac OS X 10.5.6, kern_exit.c
 612 p->p_ru->ru_maxrss = tinfo.resident_size;
task.c
1205 if (flavor == TASK_BASIC2_INFO_32) {
...
1210 basic_info->resident_size = pmap_resident_max(...);
1211 } else {
1212 basic_info->resident_size = pmap_resident_count(...);
1213 }
1214 basic_info->resident_size *= PAGE_SIZE;

Does Apple forget `/ 1024' or something? Hope Linux would not give a strange number.

Saturday, November 29, 2008

Washington, D.C.

I visited the turbo couple at Silver Spring, MD for thanksgiving (zig happened to be there, too). After enjoying a perfect homemade hot pot, we went to Washington, D.C. the next day. It was so crowded everywhere, from metro stations to museums. It made me feel even sicker when facing crazy drivers and policemen carrying guns...

The Washington Monument and the Reflecting Pool, as well as the Capitol Hill far behind and the National Museum of Natural History on the left (where we had lunch).


Another shoot.


The Lincoln Memorial and the National World War II Memorial.


The names of the States in the entablature of the Lincoln Memorial. Here goes Massachusetts, MDCCLXXXVIII (1788), when it became the sixth state to ratify the Constitution.


Squirrels everywhere. Here is one near the Reflecting Pool.


The White House and a Christmas tree.


Another Christmas tree in the Reagan airport.

Monday, November 17, 2008

One Day Off

Ah, take a breath of fresh air around Boston and Cambridge (with a visitor, amber) after the deadline, more to come though. It is getting so old in Boston. (but why 20 °C yesterday!)

Harvard Memorial Church (bird's eye).


The harbor (near the Maverick station, blue line).


Pity that I have missed shooting the colorful fall...

Thursday, October 16, 2008

When You Believe

Just can't believe some boy can sing the Oscar-winning song "When You Believe" (the main theme of the film "The Prince of Egypt") so well.

David Archuleta


Whitney Houston and Mariah Carey


He has this incredible voice. Enjoy more in Heaven and his new single Crush.

Time for the 90's.

Sunday, October 12, 2008

Mad World

This is actually a pretty old song. I like the version performed by Gary Jules.
All around me are familiar faces
Worn out places
Worn out faces
Bright and early for the daily races
Going no where
Going no where

Their tears are filling up their glasses
No expression
No expression
Hide my head I wanna drown my sorrow
No tomorrow
No tomorrow

And I find I kind of funny
I find it kind of sad
The dreams in which I’m dying are the best I’ve ever had
I find it hard to tell you
I find it hard to take
When people run in circles its a very very
Mad world
Mad world

Children waiting for the day they feel good
Happy birthday
Happy birthday
And I feel the way that every child should
Sit and listen
Sit and listen

Went to school and I was very nervous
No one knew me
No one knew me
Hello teacher tell me what’s my lesson
Look right through me
Look right through me

And I find I kind of funny
I find it kind of sad
The dreams in which I’m dying are the best I’ve ever had
I find it hard to tell you
I find it hard to take
When people run in circles its a very very
Mad world
Mad world
Enlarging your world
Mad world

Can't believe being a nearly 30-year-old, rotten guy, he is eating rubbish, taking classes, and even doing homework every day!