Source of Node<Object> in the Visual Studio memory snapshot -


i doing memory profiling application using visual studio diagnostic tool. find there node takes lot of memory (based on inclusive size diff. (bytes). (see below #1). , when click on first instance of node, 'referenced objects', see node referencing other node. , see 'overlapped data' in attribute.

how can find out creating these node mscorlib.ni.dll.

enter image description here

enter image description here

the weapon of choice when rooting through these .net framework objects decompiler. use reflector, there others.

you see opaque node<t> object back. type search box, out pops few types use it. in system.collections.concurrent namespace. well, no further, profiler told one. stack<t> class in system.collections.concurrent namespace that's storing nodes.

your profiler told there one stack<> class object owns these objects. good, narrows down single object. happens have 208 elements. hmm, well, not much, it?


that's not have stop, stack<> class pretty useless class, nobody ever uses in code. keep using decompiler , let search usages of class.

ah, nice, that's short list well. see system.data.providerbase show several times, hmm, question isn't related querying dbases. other set of references system.pinnablebuffercache.

"pinnable buffers", whoa, that's match. pinning buffer important when ask native code job done fill managed array. beginread(), universal asynchronous i/o call. driver needs stable reference array while working on async i/o request. getting stable buffer requires pinning in .net. , big bingo in profiler data, see overlappeddata, core data-structure in windows async i/o.


long story short, found this guy's project. programmers noticed, not often.


knowing when stop profiling important. cannot change code written programmer. , nobody @ microsoft thinks guy did wrong. didn't, caches things.

you done. congratulations.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -