Friday Jan 22, 2016

pstack(or thread stack) for Windows to diagnose Firefox high CPU usage

After I upgraded my Firefox, I've been suffering with CPU usage shoot up issue.
My PC is 4 core so CPU stuck at near 25% probably means single thread is in tight loop.

I recycled my old knowledge and wrote a script to dump stacktrace of a busy thread.

merging Java thread dump and native thread dump

Windows windbg/cdb.
You can sort of merge it with Java thread dump with this perl

I used a Microsoft tool called 'pslist.exe' and I wrote about it in my last entry.
Here's a sample output when I reproduced the firefox bug reported here.

$ pstack.sh firefox
0:055> cdb: Reading initial command '~26kL 2;q'
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for xul.dll -
Child-SP          RetAddr           Call Site
00000000`104a77a8 104a7908`104a9574 xul!XRE_ParseAppData+0x1a3bae
00000000`104a77b0 613325d0`00000003 0x104a7908`104a9574
quit:
0:055> cdb: Reading initial command '~26kL 2;q'
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for xul.dll -
Child-SP          RetAddr           Call Site
00000000`104ac59c 00000040`62664bd5 xul!sh::Varying::isSameVaryingAtLinkTime+0xfa2b4
00000000`104ac5a4 3216fa24`104ad56c 0x00000040`62664bd5
quit:
0:055> cdb: Reading initial command '~26kL 2;q'
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for xul.dll -
Child-SP          RetAddr           Call Site
00000000`104ac5bc 00008000`62664de1 xul!sh::Varying::isSameVaryingAtLinkTime+0x762a5
00000000`104ac5c4 00008000`104ac710 0x00008000`62664de1
quit:
0:055> cdb: Reading initial command '~26kL 2;q'
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for xul.dll -
Child-SP          RetAddr           Call Site
00000000`104a77a8 104a7908`104a9574 xul!XRE_ParseAppData+0x1a3bae

While writing this quick&dirty script, I realized that it is not possible to use 'permanent' thread id
in cdb Windows debugger so this script may not work when threads are spawned or die while running.
Oracle DB for Windows may show a similar symptom like below for valid or invalid reason.
But I don't think attaching with debugger is supported.


Tuesday Jan 19, 2016

docs.oracle.comマニュアル言語切り替えBookmarkletのソース

以下のブックマークレットを DB 11gR2 に対応しました。

docs.oracle.comマニュアルの日本語英語ページBookmarklet

英語ページまたは日本語ページを見ているときに、対応するもう一方の言語のマニュアルページに
ジャンプするブックマークレットを作ってみました

下部にあるソースを以下のアニメーションGIFのような手順でこのサイトでブックマークレット化できます。

または以下をFirefox,Chromeのブックマークエリアにドラッグ&ドロップします。今回の変更で6000byteを超えたのでInternet Explorerでは動作しないと思います。

Oracle Doc J<->E

About

Personal View of a Sales Engineer in Tokyo.

Search

Archives
« February 2016
SunMonTueWedThuFriSat
 
1
2
3
5
6
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
     
       
Today