{"id":123,"date":"2014-11-21T11:19:00","date_gmt":"2014-11-21T11:19:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2014\/11\/21\/native-memory-diagnostics-in-vs2015-preview\/"},"modified":"2021-09-27T17:12:53","modified_gmt":"2021-09-27T17:12:53","slug":"native-memory-diagnostics-in-vs2015-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/native-memory-diagnostics-in-vs2015-preview\/","title":{"rendered":"Native Memory Diagnostics in VS2015 Preview"},"content":{"rendered":"<p><span style=\"font-size: 12px;\">In Visual Studio 2013 Update 2 and also in the earlier CTP releases of Visual Studio 2015, we <\/span><a style=\"font-size: 12px;\" href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/04\/02\/diagnosing-memory-issues-with-the-new-memory-usage-tool-in-visual-studio.aspx\">released a memory diagnostic tool<\/a><span style=\"font-size: 12px;\"> that allowed developers to take heap snapshots of their application and then examine the heap contents upon terminating their application.\u00a0 The initial release supported viewing managed and native objects in the heap, and an <\/span><a style=\"font-size: 12px;\" href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2014\/06\/04\/native-memory-diagnostic-tools-for-visual-studio-14-ctp1.aspx\">update in the first Visual Studio 2015 CTP<\/a><span style=\"font-size: 12px;\"> added support for native type derivation and value inspection.\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5430.1.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28430\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5430.1.png\" alt=\"Image 5430 1\" width=\"695\" height=\"498\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5430.1.png 695w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5430.1-300x215.png 300w\" sizes=\"(max-width: 695px) 100vw, 695px\" \/><\/a><\/p>\n<p>While this tool was a good start in providing Visual Studio developers with an in-box memory profiler, it lacked the ability to easily examine heap contents at a specific program state since the entire program had to be shut down in order to drill deeper into the data.<\/p>\n<p>&nbsp;<\/p>\n<h2>Improved Memory Profiler for Preview<\/h2>\n<p>Now there is a new and improved memory profiler available in Preview that allows developers to leverage the debugger\u2019s powerful control of program flow and examine their app\u2019s heap contents at any break state.\u00a0 <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/11\/13\/memory-usage-tool-while-debugging-in-visual-studio-2015.aspx\">Here is a great overview of the new memory profiling experience<\/a> with an in-depth feature summary <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/11\/13\/memory-usage-tool-while-debugging-in-visual-studio-2015.aspx\">complete instructions on activating the feature<\/a> (<em>Where do I find it?<\/em> section).\u00a0 Upon following these instructions to activate the tool for the first time, simply pressing F5 will launch the new profiler during the debug session.\u00a0 There is now no longer a need to terminate the app to view the heap snapshots!<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/1440.2.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28420\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/1440.2.png\" alt=\"Image 1440 2\" width=\"1920\" height=\"1200\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/1440.2.png 1920w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/1440.2-300x188.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/1440.2-1024x640.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/1440.2-768x480.png 768w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/1440.2-1536x960.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>The rest of this post will focus primarily on using the new tool with native applications and details the specifics of the tool\u2019s workflow.<\/p>\n<h2>Walkthrough: Profiling a Native MFC App<\/h2>\n<p>To show off the new memory profiler, an MFC open-source chip-tune sequencer called <a href=\"http:\/\/famitracker.com\/\">FamiTracker<\/a> has been loaded into Visual Studio and modified slightly to build with the new compiler.\u00a0 After enabling the memory profiler via the reg key and starting a debug session on the app with F5, the tool loads and soon the live memory usage is shown and the heap snapshot reel appears below it:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4442.3.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28429\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4442.3.gif\" alt=\"Image 4442 3\" width=\"952\" height=\"403\" \/><\/a><\/p>\n<p><span style=\"font-size: 12px;\">Snapshots can be taken at different points in time to capture the heap state.\u00a0 Instance values are only viewable for the most recent shot and when in a break state.<\/span><span style=\"font-size: 12px;\">\u00a0\u00a0<\/span><\/p>\n<p>In this walkthrough, the initial program state for FamiTracker is the initialized sequencer UI:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/7444.4.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28436\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/7444.4.png\" alt=\"Image 7444 4\" width=\"847\" height=\"821\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/7444.4.png 847w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/7444.4-300x291.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/7444.4-768x744.png 768w\" sizes=\"(max-width: 847px) 100vw, 847px\" \/><\/a><\/p>\n<p><em>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0FamiTracker Initial Sequencer UI<\/em><\/p>\n<p><em>\u00a0<\/em><\/p>\n<p>Another dialog called the instrument editor can be launched to edit the properties of each instrument:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4011.5.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28426\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4011.5.png\" alt=\"Image 4011 5\" width=\"598\" height=\"430\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4011.5.png 598w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4011.5-300x216.png 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/a><\/p>\n<p><em>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/em>\u00a0 \u00a0 \u00a0 \u00a0<em>FamiTracker Instrument Editor Dialog<\/em><\/p>\n<p><em>\u00a0<\/em><\/p>\n<p>Using the new memory profiler, we will take heap snapshots across these two program states to better understand the runtime memory consumption of this app.<\/p>\n<p><span style=\"font-size: 12px;\">First we take a baseline snapshot to store the initial heap contents.\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4075.6.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28427\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4075.6.png\" alt=\"Image 4075 6\" width=\"695\" height=\"111\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4075.6.png 695w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4075.6-300x48.png 300w\" sizes=\"(max-width: 695px) 100vw, 695px\" \/><\/a><\/p>\n<p>The instrument editor dialog is opened, which triggers a breakpoint in the code and begins a change in program state. \u00a0This function initializes the instrument editor dialog and calls a few other helper functions that will help create the instrument editor UI.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/1651.7.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28421\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/1651.7.png\" alt=\"Image 1651 7\" width=\"738\" height=\"172\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/1651.7.png 738w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/1651.7-300x70.png 300w\" sizes=\"(max-width: 738px) 100vw, 738px\" \/><\/a><\/p>\n<p>By taking a snapshot at the breakpoint above at the beginning of <em>OnInitDialog()<\/em>, we can see the heap contents of the app just before the instrument editor dialog starts allocating objects.\u00a0 A snapshot will list the object types, counts, and memory footprint.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6813.8.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28434\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6813.8.png\" alt=\"Image 6813 8\" width=\"949\" height=\"510\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6813.8.png 949w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6813.8-300x161.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6813.8-768x413.png 768w\" sizes=\"(max-width: 949px) 100vw, 949px\" \/><\/a><\/p>\n<p>Since we are at in a break state, the instance of each type can be viewed by double-clicking a row, or the <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/0028._.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28438\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/0028._.png\" alt=\"Image 0028\" width=\"21\" height=\"19\" \/><\/a>\u00a0 icon:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3487.9.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28422\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3487.9.png\" alt=\"Image 3487 9\" width=\"917\" height=\"106\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3487.9.png 917w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3487.9-300x35.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3487.9-768x89.png 768w\" sizes=\"(max-width: 917px) 100vw, 917px\" \/><\/a><\/p>\n<p>Selecting a type will present a list of all of the allocations of that type, complete with values and allocation call stacks for each instance.\u00a0 Below are all of the instances of <em>CCHannelHandlerN163[]<\/em>:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/0755.10.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28419\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/0755.10.png\" alt=\"Image 0755 10\" width=\"948\" height=\"624\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/0755.10.png 948w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/0755.10-300x197.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/0755.10-768x506.png 768w\" sizes=\"(max-width: 948px) 100vw, 948px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>After continuing through some breakpoints, the instrument editor dialog finally pops up and a second snapshot is taken.\u00a0 Upon taking a second snapshot, we can see the total amount of memory consumed during the entire invocation of the instrument dialog, in this case a little over 50 KB.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3733.5.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28424\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3733.5.png\" alt=\"Image 3733 5\" width=\"598\" height=\"430\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3733.5.png 598w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3733.5-300x216.png 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4380.12.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28428\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4380.12.png\" alt=\"Image 4380 12\" width=\"858\" height=\"87\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4380.12.png 858w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4380.12-300x30.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/4380.12-768x78.png 768w\" sizes=\"(max-width: 858px) 100vw, 858px\" \/><\/a><\/p>\n<p>The +51,227 bytes and +405 allocations reveal the total additional memory consumed by launching the instrument editor dialog relative to the baseline snapshot #1, and the top two numbers reveal the total heap contents.\u00a0 Clicking either of these will launch the diff snapshot and list count and type of the additional objects that have exist since the previous snapshot.\u00a0 To see all object in the heap snapshot, simply click one of the two top details in the snapshot that tells the total consumption.\u00a0 Shown below is the second snapshot diffed to the first:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/8468.13.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28437\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/8468.13.png\" alt=\"Image 8468 13\" width=\"949\" height=\"525\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/8468.13.png 949w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/8468.13-300x166.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/8468.13-768x425.png 768w\" sizes=\"(max-width: 949px) 100vw, 949px\" \/><\/a><\/p>\n<p>We can even examine the memory overhead more precisely by putting breakpoints at the beginning and the end of a particular function, and taking two snapshots for comparison.\u00a0 The <em>InsertPane<\/em> function is called twice during the instrument dialog invocation, so it would be nice to see the specific impact it has on the overall execution.\u00a0 Two breakpoints have been set to encapsulate the <em>InsertPane<\/em> function, and a snapshot is taken at each break.\u00a0 In the snapshot details of the second snapshot below, we are able to clearly see that this function is consuming about 12 KB within its 20 lines of code.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6204.12.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28432\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6204.12.png\" alt=\"Image 6204 12\" width=\"1339\" height=\"536\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6204.12.png 1339w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6204.12-300x120.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6204.12-1024x410.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6204.12-768x307.png 768w\" sizes=\"(max-width: 1339px) 100vw, 1339px\" \/><\/a><\/p>\n<p>The snapshot diff technique allows any region of your code to be analyzed for memory footprint and provides a powerful tool for exposing memory leaks that may occur between states of execution.\u00a0 Once two snapshots are taken, the latest snapshot will automatically show the diff to the previous one.\u00a0 To diff non-sequential snapshots, simply click the top right corner of a snapshot and select a snapshot to diff against.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3513.13.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28423\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3513.13.png\" alt=\"Image 3513 13\" width=\"937\" height=\"87\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3513.13.png 937w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3513.13-300x28.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/3513.13-768x71.png 768w\" sizes=\"(max-width: 937px) 100vw, 937px\" \/><\/a><\/p>\n<p>This can also be done by clicking the <em>Compare to<\/em> combo-box at the top right of an opened snapshot select the desired snapshot.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5618.16.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28431\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5618.16.png\" alt=\"Image 5618 16\" width=\"425\" height=\"65\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5618.16.png 425w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5618.16-300x46.png 300w\" sizes=\"(max-width: 425px) 100vw, 425px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>&#8220;Hide Undetermined Types&#8221; View Setting<\/h2>\n<p>Due to the nature\u00a0<span style=\"font-size: 12px;\">of the tool\u2019s type derivation from PDBs, some types cannot be determined due to lack of symbols, or due to the use of custom allocators. We plan to expose the extensibility model for custom allocators in a future blog post. Since it is important to not hinder the workflow for examining user defined types with available symbols, we have chosen to hide these object by default.\u00a0<\/span><\/p>\n<p><span style=\"font-size: 12px;\">These undetermined objects can easily be seen by selecting the View Settings pull-down at the top of the heap view and unchecking the option.<\/span><\/p>\n<pre><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6355.17.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28433\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6355.17.png\" alt=\"Image 6355 17\" width=\"439\" height=\"51\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6355.17.png 439w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/6355.17-300x35.png 300w\" sizes=\"(max-width: 439px) 100vw, 439px\" \/><\/a><\/pre>\n<p>This will list the \u201cUndetermined\u201d type entry in the heap table and in turn will reveal all the instances in memory, complete with the allocation call stack.\u00a0 Below, the object instance at address &lt;0x1E1148&gt; is shown:<\/p>\n<pre><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/7345.18.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-28435\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/7345.18.png\" alt=\"Image 7345 18\" width=\"951\" height=\"491\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/7345.18.png 951w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/7345.18-300x155.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/7345.18-768x397.png 768w\" sizes=\"(max-width: 951px) 100vw, 951px\" \/><\/a><\/pre>\n<p>In the case that there are not any determined types and the default hide setting is enabled, the heap table will show a watermark with the following string:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5224.19.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-28771\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5224.19.png\" alt=\"Image 5224 19\" width=\"624\" height=\"33\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5224.19.png 624w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/11\/5224.19-300x16.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<h2>Known Issues<\/h2>\n<p>As mentioned in <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/11\/13\/memory-usage-tool-while-debugging-in-visual-studio-2015.aspx\">Charles\u2019s blog post<\/a>, the currently supported native application types are Win32, MFC and Windows Store apps. All C++ projects must be built with the new Visual Studio 2015 (v140) compiler to work properly with this tool. The following scenarios are not supported:<\/p>\n<ul>\n<li>64-bit targets<\/li>\n<li>Remote debugging of all project types<\/li>\n<li>Attach to process<\/li>\n<\/ul>\n<h2>Closing Remarks<\/h2>\n<p>This is an early version of this exciting new feature, please share your thoughts and help us make this a valuable and powerful tool for your memory diagnostic needs!<\/p>\n<p>Thanks,\nAdam Welch\nVisual C++ Team<\/p>\n<pre><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In Visual Studio 2013 Update 2 and also in the earlier CTP releases of Visual Studio 2015, we released a memory diagnostic tool that allowed developers to take heap snapshots of their application and then examine the heap contents upon terminating their application.\u00a0 The initial release supported viewing managed and native objects in the heap, [&hellip;]<\/p>\n","protected":false},"author":295,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[140,100,55,194,236,104],"class_list":["post-123","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-c","tag-c-language","tag-debugging","tag-diagnostics","tag-memory-leaks","tag-memory-management"],"acf":[],"blog_post_summary":"<p>In Visual Studio 2013 Update 2 and also in the earlier CTP releases of Visual Studio 2015, we released a memory diagnostic tool that allowed developers to take heap snapshots of their application and then examine the heap contents upon terminating their application.\u00a0 The initial release supported viewing managed and native objects in the heap, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/295"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=123"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/123\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}