亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

InvestigatingissueswithUnmanagedMemory.Firststeps.(轉載)

2019-11-14 16:22:56
字體:
來源:轉載
供稿:網友

原文:http://kate-butenko.blogspot.tw/2012/07/investigating-issues-with-unmanaged.html

I want to write this blogpost really fast, until I forget everything, despite I have absolutely no time and need to work on other cases :( Let's count this as part of my work, okay?

PRologue.

You can scroll it down to scene 1, if you want to concentrate on concrete steps.

This case had a long story - starting from OOM troubles on 32-bit process, when process 32-bit mode was considered as main boundary for a large solution. BTW, my troubles with opening dumps at that point resulted in this blog post, if you remember it.
After switching to 64bit solution was running smoothly for some time, we even closed the support case. Suddenly (oh, I love this Word!) our poor process had eaten 66Gb of memory, which is unbelievably huge. Actually, it was all of the memory available - 16Gb of RAM and 50Gb of page file.


Customer managed to gather a dump when process memory usage was at something like 6Gb. I was almost sure, that issue solution is struggling because of was this bad guy - Lucene analyzer. Luckily, we have script that counts all related to this issue data structures (and also counts cache sizes), so I thought that I will just run this script on the dump and confirm my assumptions.


I was a bit shocked when script has shown only 140Mb of Lucene-related things in memory. Cache sizes were in healthy range. So this is something new. I loaded our good old friend WinDBG and started analyzing memory as usually.

Scene 1.


1. !dumpheap -stat. One suspicious thing that I noticed in the dumpheap was that largest memory eater was not that large:


Approximate size of strings is ~775mb, and a lot of Free objects were telling me that a lot of memory is not compacted. Other objects are related to different Sitecore caches.

But what even 1.7Gb means against having a ~5.8Gb dump? That was a question.

2.!address -summary. This command will output all memory usage for the process. Managed, unmanaged, commited, available virtual memory - whatever you can imagine:


Ok, that's a bit better. At least I can see that there is ~5.5Gb of committed memory (MEM_COMMIT), which corresponds approximately to process' Private Bytes, so size of dump is not coming from nowhere. But from somewhere.

3. !eeheap -gc. This nice command shows us all our managed heaps one by one, and for each heap shows its Small object heap and Large object heap addresses and sizes.


That's what I was interested in - total size of managed memory heap. Sadly, it says that GC heap is only 2Gb it size - the same that we may assume from !dumpheap results. If it was not this case, we can take more from output of !eeheap -gc, for example search for largest LOH, take a look at sizes of generations in GC and possibly derive something useful.

But commited memory 5.5Gb against 2Gb of GC managed memory shows us that we face this scary unmanaged memory thing. Oh no :(

I searched through ton of sites looking for concrete steps of debugging such issues in WinDBG. Steps below are currently the one and only scenario, that worked for me. I'm sure that there are much more possible ways of solving, but we are not able to know everything in this world, aren't we?

Scene 2.

So later in this article we are investigating our native heaps. Native means unmanaged - our GC has nothing to do with native memory, it will never be collected or compacted until application is closed and everything that belongs to it is freed.

4. !heap -s

Let's look at the native heaps. One of the heaps takes ~3Gb. So this is the place where most part of our lost memory goes! Remember this heap number 12240000. We'll see it again later.

Now let's take a closer look at the structure of native heaps, using following command:

5. !heap -stat -h 0

Among all allocation statistic information for all heaps find the ones that are the most exhausted. It means that most of total busy bytes is close to 100. In my dump I had several such heaps, but most of them aren't causing problems, according to results of step 4. This 12240000 is under big question now.

From the output above we can also see that all this heap is filled with blocks of equal size - 7c10. Next command will allow us filter heaps to find blocks of this only size.

6. !heap -flt s 7c10


Good explanation of each of the columns: http://stackoverflow.com/questions/6687414/what-do-the-different-columns-in-the-heap-flt-s-xxxx-windbg-command-represe

Now be careful. Most of the sites and guides on the Internet will now offer you to go through UserPtrs and look at the stacks that are pointing to this UserPtrs. For example, this one: http://windbg.info/doc/1-common-cmds.html#20_memory_heap, scroll down to "Finding memory leaks", steps 5-8. I recognize that this scenario may be useful sometimes, but nobody says that in 90% of cases stacks are not present there :)

First my thought was that I have nothing else to admit except of the fact that I'm stuck here. Searching for anything related leaded me to the steps like in article above, but this scenario was of no use. I even asked my other experienced colleagues and US support about any ideas, but seems that nobody have ever seen this before.

Occasionaly, while hopelessly searching for just general information on native memory leaks, I bumped into a simple blog post http://www.manicai.net/comp/debugging/oom/. Man, I should give you all the credit for this post, as you saved my head from explosion.

Frankly saying, I wasn't able to repeat all the steps from the blog above, but even the beginning has given me a chance to find out what is wrong.

7. dc 00000000122412e0  L 2000

Address is taken as the first HEAP_ENTRY from previous screenshot - address of first block of that size. "dc" command display us raw memory in double word bytes and ASCII characters corresponding to them. L 2000 means that we will take 2000 of these double words.

We will get a large output, scroll over it and find interesting places, if you have them:

beginning of the "dc" output

Cool. There is definitely some repeating string, like <div class="container"><span></span></div>... and this string is being repeated forever.

somewhere in the middle of the "dc" output

Another eye-catching place. Among all these repeating spans some piece of the content is jumping into: Fredagsklumme-Faellesskab-og-ho... and some styling before this content.


end of dots-range in "dc"-output

Then our content piece is followed by a lot of dots and ends up with all this div-span thing again.


Actually, it was the brilliant moment - find some meaningful strings in all this garbage-looking native heap. 

My next step was just to ask customer about nature of this string, and he has successfully found something similar in their XSLT files and found related content in one of the Sitecore fields. Most of all, this memory leak was caused by incorrect parsing some content markup by this xslt.

Epilogue.

...and the moral of this story:

Guys, please keep posting! Especially about the things that are not that obvious and that you spent a lot of time on.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
国产精品久久久久久超碰| 91免费的视频在线播放| 中文字幕不卡av| 欧美成在线观看| 国产精品久久久久久久久久久久久久| 亚洲视频在线免费观看| 欧美成人精品在线| 136fldh精品导航福利| 欧美日韩精品在线观看| 国产欧美精品日韩精品| 国产亚洲精品日韩| 久久成人av网站| 中文字幕日韩欧美| 中文综合在线观看| 成人激情在线播放| 亚洲欧美日韩图片| 国产有码在线一区二区视频| 欧美日韩国产成人在线观看| 日韩一二三在线视频播| 国产视频在线一区二区| 欧美激情久久久久久| 精品夜色国产国偷在线| 亚洲欧美日韩直播| 国产精品激情av在线播放| 91日本视频在线| 欧美性69xxxx肥| 成人美女av在线直播| 久久久女人电视剧免费播放下载| 欧美激情一区二区三区在线视频观看| 日产日韩在线亚洲欧美| 久久男人av资源网站| 欧美激情一级欧美精品| 国产视频久久久久久久| 91av成人在线| 日韩亚洲精品电影| 午夜精品久久久久久久99黑人| 91色视频在线观看| 97精品国产aⅴ7777| 亚洲精品av在线播放| 日韩中文字幕视频在线观看| 一区二区三区在线播放欧美| 欧美做受高潮电影o| 国产精品偷伦视频免费观看国产| 亚洲已满18点击进入在线看片| 久久久视频免费观看| 91国产精品视频在线| 欧美午夜片欧美片在线观看| 日韩在线视频免费观看| 欧美大片网站在线观看| 欧美激情免费看| 亚洲人成在线观看| 亚洲人成网站在线播| 亚洲欧美成人一区二区在线电影| 8090成年在线看片午夜| 久久天堂av综合合色| 欧美一区二区三区精品电影| 亚洲自拍偷拍视频| 51ⅴ精品国产91久久久久久| 91在线|亚洲| 日韩av一区二区在线观看| 久久91精品国产| 在线播放国产一区二区三区| 永久免费看mv网站入口亚洲| 91精品在线播放| 日韩电影免费观看在线观看| 92裸体在线视频网站| 欧美日韩精品在线观看| 欧美日韩另类字幕中文| 欧美性生交xxxxxdddd| 亚洲国产91精品在线观看| 国产精品久久久久9999| 国产999在线| 亚洲激情久久久| 日韩国产一区三区| 日本久久久久久久久久久| 国产亚洲视频在线| 日本午夜人人精品| 久久久久国产一区二区三区| 国产精品三级在线| 91精品中文在线| 丝袜情趣国产精品| 日韩精品中文字幕在线| 国产成人精品综合久久久| 国产在线观看一区二区三区| 亚洲自拍小视频免费观看| 亚洲第一页自拍| 这里只有精品视频在线| 亚洲欧洲av一区二区| 97国产在线视频| 在线观看国产精品91| 国产精品视频久久久久| 日韩欧美精品免费在线| 久久亚洲欧美日韩精品专区| 久久久免费精品视频| 久久伊人色综合| 国产亚洲美女精品久久久| 国产亚洲人成网站在线观看| 国产精品老女人视频| 亚洲国产精品999| 91日本在线视频| 91久久精品视频| 亚洲综合av影视| 日韩在线一区二区三区免费视频| 久久久精品中文字幕| 日韩高清免费在线| 欧美性猛xxx| 久久九九免费视频| 在线免费看av不卡| 色悠久久久久综合先锋影音下载| 国外成人免费在线播放| 久久精品亚洲国产| 亚洲欧美国产精品久久久久久久| 国语对白做受69| 伊人久久综合97精品| 成人免费网站在线观看| 日韩h在线观看| 欧美成人免费视频| 国产精品成人va在线观看| 成人情趣片在线观看免费| 国产一区红桃视频| 最近2019年中文视频免费在线观看| 日韩少妇与小伙激情| 欧美肥老太性生活视频| 色99之美女主播在线视频| **欧美日韩vr在线| 国产欧美日韩综合精品| 黑人精品xxx一区| 亚洲字幕在线观看| 日韩精品亚洲精品| 亚洲高清久久网| 亚洲国产天堂久久综合| 不卡毛片在线看| 成人午夜高潮视频| 国产999精品视频| 欧美性xxxx| 亚洲男人第一网站| 久久久久北条麻妃免费看| 亚洲欧美日韩中文在线制服| 亚洲福利在线视频| 日韩在线视频中文字幕| 久久久久久这里只有精品| 欧美国产日韩中文字幕在线| 国产精品视频一区国模私拍| 亚洲男人的天堂在线| 精品国产乱码久久久久久虫虫漫画| 亚洲人午夜精品| 国产成人精品免高潮费视频| 91精品久久久久久久久久久久久| 亚洲国产精品成人av| 欧美精品成人在线| 国产精品自拍网| 欧美一区二区色| 国产视频一区在线| 国产精品亚发布| 日韩精品免费在线观看| 中文字幕一区二区精品| 日韩av在线网页| 高清日韩电视剧大全免费播放在线观看| 欧美性理论片在线观看片免费| 国产成人一区二区在线| 欧美一乱一性一交一视频| 国产精品无av码在线观看| 久久久精品欧美| 深夜福利国产精品|