Remember a memory leak dump analysis

Source: Internet
Author: User
Tags mscorlib amq

Since entering a start-up company, gradually become a dog, but have no harvest, feel their technical ability to play a few, work life in business logic upside down.

The previous antennas on the service memory is tight, let operation to take down the dump, analysis of consolation.

Let's start by counting the big object information.

0:000>!dumpheap-min 85000-statstatistics:              MT    Count    totalsize Class name000007feec34c168        7     57734750 system.char[]000007feec34aee0    115469904 system.string00000000013032d0      101    621925414      freetotal 122 objectsfragmented blocks larger than 0.5 MB:            Addr     Size      followed by000000010d382018    2.8MB 000000010d645e90 system.string000000010d971aa8    1.8MB 000000010db43530 system.random000000010db70bd0    1.1MB 000000010dc8e238 system.string000000010dd2f6a8    0.7MB 000000010ddd9160 system.random000000010ddd92e8    1.1MB 000000010dee8d38 System.Security.Cryptography.SafeHashHandle000000010e223090    3.0MB 000000010E51DCC8 system.random

Look at the string

0:000>!dumpheap-type system.string-min 85000         Address               MT     size00000004ffed5250 000007feec34aee0 12721650     0000000501f4aec0 000007feec34aee0  1322018     000000050208dae8 000007feec34aee0  1322022     00000005021d0710 000007feec34aee0 12726120     0000000502df3678 000007feec34aee0 12726124     00000005121b3168 000007feec34aee0 12726120     000000052001c2b0 000007feec34aee0 12721654     0000000521053930 000007feec34aee0   732168     00000005211b9120 000007feec34aee0   732168     00000005216efa08 000007feec34aee0 12726124     0000000522312978 000007feec34aee0 12726124     00000005307564d8 000007feec34aee0  4780744     0000000531074a50 000007feec34aee0  4780748     0000000531503d20 000007feec34aee0 12726120     Statistics:              MT    Count    totalsize Class name000007feec34aee0    115469904 System.String

View string Details

0:000>! DUMPOBJ/D 0000000501f4aec0name:        system.stringmethodtable:000007feec34aee0eeclass:     000007feebcb3720Size:        1322018 (0X142C22) Bytesfile:        C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dllString:      {" Salepricestrategylist ": [{" Saleruleid ": 5178," Strategytypeid ": 5," Strategytypename ":" Standard sale ...

  

0:000> DC 00000004ffed5250 L100000000004 ' ffed5250 ec34aee0 000007fe 00610eec 0022007b. 4.......a.{. ". 00000004 ' ffed5260 00720050 0064006f 00630075 00490074 p.r.o.d.u.c.t.i.00000004 ' ffed5270 00220064 0034003a 00390037 002c 0031 D.:. 4.7.9.1.,.00000004 ' ffed5280 00500022 006f0072 00750064 00740063 ". p.r.o.d.u.c.t.00000004 ' ffed5290 0061004e 0065006d 003a0022 4e3d0022 N.A.M.E. ".:.". =n00000004 ' ffed52a0 002d6c5f 683c9999 62c991cc 901a76f4 _l-... 

Found to be the result of a fingerprint or a pin-controlled cache counter sequence.

Similarly look at the character array, the result is similar.

Continue, parsing threads

0:000>!threadsthreadcount:      1710UnstartedThread:  1backgroundthread:122pendingthread:    0DeadThread :       1587Hosted Runtime:   No

Found Deadthread many, in a similar way, found that the address of these threads are in the Terminator queue GCHandle, speculation in the room for a short period of time amq batch triggering and not a large number of pooled thread pool of existing threads caused a new opening up a lot of additional threads. Discovery through the call stack is true:

0:000>!clrstackos Thread id:0x5718 () child SP IP call Site0000000013e8e6c8 000000007706df6a [ GCFRAME:0000000013E8E6C8] 0000000013e8e798 000000007706df6a [helpermethodframe_1obj:0000000013e8e798] System.Threading.Monitor.ObjWait (Boolean, Int32, System.Object) 0000000013e8e8b0 000007fe9302c6da Apache.NMS.ActiveMQ.Threads.DedicatedTaskRunner.Run () 0000000013e8e930 000007feec19f8a5 System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 0000000013e8ea90 000007feec19f609 System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 0000000013e8eac0 000007feec19f5c7 System.Threading.ExecutionContext.Run ( System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 0000000013E8EB10 000007feec1b2d21 System.Threading.ThreadHelper.ThreadStart () 0000000013e8ee28 000007feed27f713 [gcframe: 0000000013e8EE28] 0000000013e8f158 000007feed27f713 [debuggeru2mcatchhandlerframe:0000000013e8f158] 0000000013e8f338 000007feed27f713 [contexttransitionframe:0000000013e8f338] 0000000013e8f528 000007feed27f713 [  DEBUGGERU2MCATCHHANDLERFRAME:0000000013E8F528]

Speculation is due to amq a short period of time in the batch trigger fingerprint, pin-controlled cache update caused.

I was going to deal with the problem of cache deserialization of large objects, improving AMQ batch triggering to open up too many threads, and whether there are non-unsubscribe subscriptions, but the product is over, the business code is good No ""

Remember a memory leak dump analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.