Jul 27
IUSR咿咿呀呀 feel, linkedin
西下的夕阳,透过舷窗,把阳光洒在前排座椅的靠背上。舷窗的玻璃就好像三棱镜一样,在我的面前描出一条虹。从来没有看到过阳光以接近水平的角度照在自己面前,也从来没有离开家这么久过。
当起飞前飞机缓缓地驶在杜塞尔多夫机场的跑道上时,离别的感觉再次涌上心头。也许因为我自己就是个随遇而安的人吧,无论在哪里呆久了,都会有种家的感觉,或者是,错觉。直到现在,我还记得在波恩的那个Hotel Domicil的每一天,既有第一次走进自己那间超袖珍房间时的惊讶,第一宿的凌晨被早班公车闹醒时的无奈,也有听着音乐啜着咖啡看着天窗被雨水冲拭的惬意,周日阳光下昏昏欲睡的慵懒。
波恩,昔日西德的首都,莱茵河畔的明珠,今天却宁静得像一个小镇。比较现代一些的产业,比如金融和IT,渐渐地聚拢在法兰克福、慕尼黑这些地方,波恩仿佛卸下重担一般,摇身变为朴素的欧洲小城。这个城市真的是很宁静。来到这里之前,我只知道那夏季午后的天津,在人们或闭门不出或瞌睡连连的时候,阳光孤单地照在柏油路上,反射出一种不自然的冷清,却不是宁静。而在波恩,即使是周六集市时的广场,也是安详到让我感觉费解。在其他的城市都铆足劲头想变成繁忙的国际大都市的时候,这种宁静尤其难得,而且几乎掩盖了这次行程的第一站——繁忙喧嚣的伦敦——给我留下的所有印象。
最后一周因为实在受不了临街房间的喧闹,换到了内院的房间。清晨醒来的时候,揉醒睡眼走下楼梯后的第一件事,就是掀开窗帘推开窗子。楼下就是酒店的后院。在宁静的清晨,除了偶尔的一两声鸟鸣人语,其余的时候只能听到风吹过层叠的树叶时擦出的柔顺的沙沙声。在晨曦中把自己拾掇完毕,就可以开心地走去享受丰盛的早餐。每天早晨的这顿饭,其丰盛和美味是毋庸赘述的,我最享受的,却还是坐在窗边端着咖啡发呆的时间。通常这种享受都是很短暂的,因为毕竟不是来旅游的,每天还有不少工作要做,但就是这种轻松惬意的感觉,让我觉得可以轻松瓦解这一天即将纷至沓来的劳顿。
现代的商业化的旅行可以留给人们的只是无穷无尽的照片和乏味的纪念品,若干年以后,凭借这些线索,我们是可以拾起当时的欢快和新鲜,仅此而已。我相信,真正去生活在一个地方,是截然不同的另外一回事。
当不期而遇的太阳雨冲刷着屋顶大块的玻璃时,伴着悠扬的音乐,我忘记了拍下阳光下雨水的舞蹈。当徜徉在夜晚的大街上,感受着吹拂而过的有些萧瑟的微风时,我不知是该拍下黑乎乎的街道,还是该拍下吹面不寒的夜风。当我蜷缩在矮脚沙发里,晒着和煦的阳光几乎要打起瞌睡的时候,我不知是该拍下这暖意,还是该拍下这恍惚间匆匆流过的时间。
临行前,整理了一下在波恩拍下的所有照片。比起在伦敦拍的那些照片,在波恩拍摄的照片明显少很多。我突然感觉到一些无奈,还有一些空虚。那些实实在在的感受,我是无法记录的,也无法带走。它们就像天边飞舞的浮云,一旦飘散,再也无法聚拢。时间终会冲淡这一切感受,我永远无从逃避。
舷窗外的夕阳已经看不到了,只有橘红色的云彩描绘着它落下的痕迹。没有飞到这三万英尺的高度,我永远不可能看到这景致,就像没有去过波恩,我永远不可能理解一个城市的宁静。
再见,波恩。
Jul 20
IUSR咿咿呀呀 feel, linkedin
新的一周开始了,离回家的日子越来越近了。
突然有种奇怪的感觉。回家了,可以找回以前熟悉的日子,过有些单调却亲切的生活,却丢掉了这里的日子,丢掉了异国情调,蓝天白云青草地。就是这样说不清楚的感觉。
又或者说,无论离开那里,都会是同一种感觉吧。
今天是周日,本来打算去教堂和波恩大学转转,结果QA同事们要加班测试,虽然我不是QA,不过support总还是要做的,即使我远不如公司里那些牛人了解这个庞杂的系统。
吃过早点回到屋里,静候组织调遣。随意地缩在沙发里晒太阳,腿放在桌子上,架着笔记本,Dido的Thank
You从打开的pandora适时地飘出来,那种说不出的无限慵懒一瞬间涌满全身。这种不曾拥有过的惬意,也只有在这种情境下才可能滋生。没有紧张,没有焦虑,就像阳光下的向日葵,带着一副什么都不在乎的表情在微风里摇摆。
组织的决定自然是加班,否则今天肯定出去逛了。其实加班也无所谓,我基本上是没事干的,就帮着查了查一个协议方面的问题。工作也是在酒店里做。4个人进到吸烟区——因为负责测试的QA
lead嗜烟如命——找椅子坐下,就是简单的办公室了。吸烟区其实是个不错的地方,房顶是玻璃的,丝毫不阻碍阳光晒进来,坐在里面就像进到花房一样,舒坦得像小花小草一样。
给同事——一QA MM——推荐了Thank You,结果该MM一下午放了大概20来次这首歌…小资的感觉看来人人都喜欢啊。
吃过晚饭和2个中国同事去附近转转。周日是比较安静的,或者也可以说比较无聊。商店基本都停业了,即使营业也是关门很早。转了一会儿突然那个QA
MM发现了家哈根达斯,而且还没打烊,于是乎伊很大手笔地请我们吃哈根达斯。我们三个人还把手里的冰淇淋举在一起拍了张照片——感觉很像三个火枪手举剑的动作,虽说照片的主角是冰淇淋吧。
周日夜晚的波恩静得很安详,和同事随意地走着,有种熟悉的感觉从心底淡淡地飘忽出来。这种感觉,只有在大四和全班同学通宵K歌后走在清晨的路上时出现过。说不出这是种什么样的感觉,只是心境和环境是一样的:离开,安静的大街,熟识的人。
My tea’s gone cold, I’m wondering why. I got out of bed at all…
Aug 29
IUSR技术文章 english, java, linkedin, troubleshooting
A summary of my recent experience with resolving an 100% CPU utilization issue.
We know well that in Java 5 and above we have the mighty java.lang.management.ThreadMXBean which is able to give us almost all ordinary diagnostics information of a given thread, except more detailed information that only debuggers are able to tell. However, such information is implementation/vendor dependent and some information, like CPU time measurement, might be disabled by default, and moreover, in my humble opinion, these information may be not very accurate since they are reported by the JVM itself, not by the OS.
Luckily, almost every popular OS supports some means of measurements down to the threading level, and on the Java side, we have the thread dump (of course, also in popular JVM implementations). I’m here taking Ubuntu, Windows XP with SUN JVM (5.0 for Windows and 6.0 for Linux) as an example. This example demonstrates the process to find the thread that is utilizing unusual amount of CPU time in a Tomcat instance hosting a very simple web application.
When there’s something wrong caused by the JVM, say, similarly, it simply occupies all CPU time, you can always find the guilty threads by doing so:
1. Getting threading information from the OS.
In most Linux distros, a single ps command can handle this. For instance, ps H -eo user,pid,ppid,tid,time,%cpu,cmd –sort=-%cpu , will print out all the processes and their created threads, sorted by the percentage of overall CPU utilization. We can always RTFM for more information about *nix commands;)

In Windows, however, getting threading information for a process might be harder. I suggest using Process Explorer, which is the most easy to use tool amongst other equivalents.
First of all, open the “Properties” dialog of the JVM process.

Next, click on the “Threads” tab to see threads of the process. You can see that they are sorted by CPU utilization by default.

(I have a dual core CPU and this thread is occupying a whole core)
2. Getting a thread dump from JVM.
This task should be easier for us as Java developers;) In Linux we use kill -3 PID,

(I was running less logs/catalina.out after the thread dump, because I wrongly started Tomcat by bin/catalina.sh start instead of bin/catalina.sh run. Never mind)
and in Windows we can simply hit Ctrl+Break in the console window that is running the JVM process.

3. Finding out the Java thread from
Usually the thread ID printed by the OS are in decimal format, and this value needs to be converted into a hexadecimal. And next, no other magic other than finding “nid=xxx” terms in the thread dump. See highlighted parts:
7772=0x1E5C

2148=0×864

Yep, that’s it, test.Test.test();. I’m not going to amuse you by posting the source of test.Test.test(), since it’s no more than an infinite loop:D
Regards and hope this helps.
Apr 09
IUSR技术文章 eclipse, english, java, linkedin, performance
I did this long ago. Since I’m not required to do it repeatedly, it took me another 15 minutes to get warmed up. This time I’m recording the procedures here as a preparation for tomorrow’s exploration on why the hell that tomcat instance was taking so long to start up.
- JVM arguments: -XrunpiAgent:server=standalone,file=/home/iusr/tc.trcxml,profile=/home/iusr/piAgent.options,filters=/home/iusr/piAgent.filters. It’s convenient to export all this twittering to JAVA_OPTS which is used by tomcat to pass to JVM;
- Adjust the LD_LIBRARY_PATH environment variable to include directory “<eclipse_install_or_ext_point>/plugins/org.eclipse.hyades.execution.<OS>.<CPU_ARCH>_<VERSION>”, e.g., in my Edgy box it’s “/usr/local/eclipse-extension/eclipse.org/tptp/eclipse/plugins/org.eclipse.hyades.execution.linux.x86_4.2.2.v200701141614″;
- Compose the profile configuration, filters configuration. Refer to http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.tptp.platform.doc.user/ref/rsaproffilt.htm and http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.tptp.platform.doc.user/tasks/teprofsa.htm for the proper format.
- Run the java class, of course:)
A profile configuration consists several entries, here’s an example (“^\*.*$” lines stand for comments):
* all | none
MONITOR_MODE = all
* true | false
FILTERS = true
* none | deletes | frees | moves | deletesAndMoves | movesAndFrees
TRACK_GC_EVENT_TYPES = movesAndFrees
* static | relocatable | staticAndRelocatable
ID_STYLE = staticAndRelocatable
* true | false
* OPTIONS = false
TIMESTAMPS = true
METHOD_COUNTS = true
OBJ_ALLOC_IS_ARRAY = true
* none | normal | boundary | contiguous | boundaryAndContiguous
STACK_INFORMATION = contiguous
* true | false
* TICKET = true
* full | none | noObjectCorrelation
TRACE_MODE = full
* true | false
* TRACE_ID_REFS = true
Apparently this configuration requires much work to do, so my CPU got 99% utilized just now:P.
The filters configuration is more straightforward, only a wildcard string indicating the desired packages or classes, another wildcard string indicating the methods, and a directive indicating the whether matching packages or classes are to be included or excluded. Here’s an example:
package = com.*
method = *
mode = INCLUDE
Since some subtle differences amongst different Linux distros and versions, the configuration above varies. I once saw a web page saying it’s necessary to add the directory “<eclipse_install_or_ext_point>/plugins/org.eclipse.hyades.execution.<OS>.<CPU_ARCH>_<VERSION>” not only to LD_LIBRARY_PATH but also to PATH. I haven’t tried this out yet, since adding it to LD_LIBRARY_PATH works every time and appears to be more reasonable. Particularly, if the piAgent failed to get loaded or started, take a look at the output of `ldd <eclipse_install_or_ext_point>/plugins/org.eclipse.hyades.execution.<OS>.<CPU_ARCH>_<VERSION>/libpiAgent.so` to check out if there’s anything dependent missing.
Whoa, I cannot help starting the agent on our main testing machine to find out what the hell contributed to the latencies.
Apr 03
IUSR技术文章 english, linkedin
I’d never imagined that one day I would be working in a very much limited environment, and thus applications like Portable Firefox which tend to be as much __green__ as possible had never got my attention. But nowadays, I’ve completely changed my attitude towards such applications.
Accessing windows registry? Forbidden. Configuring system services? Forbidden. Mapping network drivers other than the ones specified by the almighty administrator(s)? Forbidden. Installing an ActiveX plugin such as Adobe Flash Player to the poor naked IE? Forbidden, of course. Although I’ve always had enough with those bursting flash objects in web pages, being expropriated the chance to selectively enjoy good flash objects is very unpleasant. Right, just unpleasant, and it can never be frustrating, muhaha!
Time comes to introduce a very old friend of mine that for long I’ve even forgotten its existence: the tiny browser named K-Melon. It’s really a very old friend of mine, no kidding. It was my first alternative choice of browsers when I was a really newbie using Windows 98 SE. By using K-Melon, I gradually got to know firebird, the bird which today has mutated to an animal called firefox, and some other browsers sharing the same Gecko rendering kernel. I admit it was not very attractive at that time, with an ugly UI, lacking enough extension and plugins; you’ll have to forgive my nearsightedness, because browsers other than IE didn’t have an easy life to deal with at that time, and neither were their users that had chosen them as their primary or even secondary browser. So gradually it disappeared from my hard drive.
Till just now:)
As what I mentioned above, I’m currently working in a very limited environment and I even cannot install a flash player plugin to the IE I’m using. Moreover, I cannot install any other applications since I don’t have the mythical permissions of accessing both registry and some file systems. What’s more, even Portable Firefox cannot start due to some failures in the underlying XPCOM layer. Cool…
For God’s sake, K-Melon is working very well even under such circumstances, the only problem was that all flash player installation programs I grabbed from adobe.com couldn’t run properly, mentioning me that I was not the almighty administrator whom I think I can never be. Nevertheless, it’s not even a competent problem for someone who has a rough understanding about the Mozilla family browsers: copy what you have in $MOZILLA_OR_FIREFOX_OR_WHATEVER/plugins/ that have something to do with flash to the same named directory in the K-Melon installation directory, and restart your running K-Melon if there’s any. Then navigate to wherever a flash object dwells, whoa, I have my beloved flash now:)
It’s still mysterious why firefox and Portable Firefox failed on the system, they should have followed well the Unix philosophy, or am I just putting too much burden on them?:) Never mind, I’d never thought that those Flash objects hungering for CPU and memory could some day be so genial as well after several days of parting.
Mar 20
IUSR技术文章 english, linkedin
Not quite sure about this, but from a recent clue posted on slashdot, this insane patent is probably true. And some comments on slashdot points out it’s triply linked list that got patented, not our good old linked list or doubly linked list. Nevertheless, it’s still not that difficult to make varieties of existing data structures and/or algorithms and register a patent for it.
Whoa, I’d better go back to my algorithm books and make a summary of remaining patent-able data structures and/or algorithms. Oops, first of all, I need a companion with a US nationality. Who’s interested?
I see in your eyes, the same scorn that would take the heart of me.
All mighty US patent agencies! Haven’t they realized most computer stuff originate from the US, and with their fingers they can probably affect this fragile industry?
Newer Entries
Recent Comments