With Windows Phone there is a world-class developer ecosystem, top notch mobile tools and great educational materials. Windows Phone apps can tap into the power of multi-tasking, access thousands of APIs, use Silverlight features, and take advantage of hardware features such as hardware acceleration. With the release of Nokia Windows Phone, the number of people who will be able to access your applications is also increasing fast. There has never been a better time to dive into Windows Phone development.Mobile Code Samples
22 new code samples cover nearly all the new features for Windows Phone 7.5 (Mango) including the most requested and hotly anticipated areas - camera, media, sockets, sensors, SL/XNA integration, Tile backgrounds and background agents.Click here to download

Backstory: Building the Office Blogs app for Windows Phone
p>I love behind-the-scenes stories about apps, which I find helpful as I work on my first one for Windows Phone. Today Microsoft"™s Craig Kerwien provides the creation story for the a href="http://www.windowsphone.com/en-US/apps/db1b43ce-6b8d-41f3-96d1-ea3a8fb0bb52">official Office Blogs app/a>, which hit Marketplace last week. /p> p>a href="http://blogs.office.com/b/office_blog/archive/2012/02/22/building-the-office-blog-app-for-the-windows-phone-7.aspx">In the post/a>, Craig talks about how the effort went from a weekend DIY project"”he"™s a hobbyist, not a full-time developer"”to an official Microsoft-sponsored app, and sketches out how he coded it using some of Chris Koenig"™s popular a href="http://code.msdn.microsoft.com/site/search?f%5B0%5D.Type=Topic&f%5B0%5D.Value=Getting%20Started&f%5B0%5D.Text=Getting%20Started&f%5B1%5D.Type=User&f%5B1%5D.Value=ChrisKoenig&f%5B1%5D.Text=ChrisKoenig">starter kits/a> (which I"™m also a fan of). It"™s a fun read, especially if you"™re just starting out. /p> p>Speaking of good reads, here"™s a question: What kinds of posts would you like to read on the Windows Phone Developer Blog in 2012? As we plan our editorial calendar for the year, we"™re kicking around ideas like developer profiles and behind-the-app posts, beginner"™s columns and code samples. /p> p>But what would em>you/em> like to see? We"™re all ears./p> p>img style="margin: 0px 10px 0px 0px; border: 0px currentcolor; display: inline; background-image: none;" title="The official Office Blogs app for Windows Phone" border="0" alt="The official Office Blogs app for Windows Phone" src="http://catalog.zune.net/v3.2/en-US/image/381fd7c9-e404-4574-991a-9b36e2f82a31?width=1280&height=720&resize=true" width="288" height="480" />img title="The official Office Blogs app for Windows Phone" alt="The official Office Blogs app for Windows Phone" src="http://catalog.zune.net/v3.2/en-US/image/85f8f8b0-fc6a-47da-a311-8fa43facfefe?width=1280&height=720&resize=true" width="288" height="480" />/p>div style="clear:both;">/div>img src="http://windowsteamblog.com/aggbug.aspx?PostID=577102" width="1" height="1">
Find My Champ
p>What do you think of when you hear the word "Champ"? Someone who is the best? A sports champion? How about someone who fights for a cause? Here at Microsoft we have employees called "Developer Evangelists". Part of their job is to help get the word out about Microsoft products and technologies. The other part of their job is to champion our developers./p> p>Here in Windows Phone we call our evangelists "Phone Champs". Champs ensure our developers get exactly the help & support they need and are the voice of the developer community. They are all experts on our platform and serve as local resources to answer questions from current or prospective developers. Champs can help you troubleshoot a problem in your app and can help you get your hands on a phone for testing. Oh, and some of our Champs are really funny and can tell you a good joke or two. img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/2210.wlEmoticon_2D00_smile_5F00_4904DFAD.png" />/p> p>So how do you find one of our great Phone Champs? Today I"™m happy to announce a new application to help you find them. We originally wanted to call the app "Champ Acquisition and Discovery 1.0 for Workgroups Windows Phone Edition." Luckily cooler heads prevailed and we"™re calling it "Find My Champ"./p> p>The app was a team effort and I thank two of our Phone Champs for their help: a href="http://blog.jerrynixon.com">Jerry Nixon/a> and a href="http://blogs.msdn.com/b/mz">Max Zilberman/a>./p> p> /p> p>b>Quick Look at Find My Champ/b>/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/0243.image_5F00_4FB7E930.png">img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/4762.image_5F00_thumb_5F00_0F159CC1.png" width="253" height="484" />/a>/p> p>As you can see above, there are two main pivots: all & local. The first picture shows the "local" pivot, as someone in Paris would see it. We see that there are three Phone Champs within 250km of the phone"™s current location./p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/6787.image_5F00_3981CDDE.png">img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/0535.image_5F00_thumb_5F00_467BADEF.png" width="580" height="304" />/a>/p> p>Next we see what happens when the phone is rotated. A map comes up and shows all the Phone Champs as pushpins. Tapping a Phone Champ"™s pushpin (or on their name in the list in the first image) reveals the contact info that a Phone Champ has chosen to share:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/8473.image_5F00_2C3B44CB.png">img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/2626.image_5F00_thumb_5F00_529D2816.png" width="254" height="484" />/a>/p> p>b> /b>/p> p>b>Get the App/b>/p> p>Go a href="http://findmychamp.codeplex.com/">download the app"™s source code/a>. Compile the code in our a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27570">dev tools/a> and side-load Find My Champ onto your developer device or into the emulator. The app will also be in the Marketplace soon for you to download. Find your local Phone Champ and get in touch with them. Ask them for help with your app or to let you know about events or hackathons in your area./p> p>We"™d love to get your feedback on the Find My Champ application. Tell us what we can do to make it more useful. You can also come help us improve the app on a href="http://findmychamp.codeplex.com/">Codeplex/a>. Additionally, I suspect that many of you will have creative ideas for how to use the a href="http://champ.cloudapp.net/ChampDataService.svc">Champs OData feed/a> in other applications, mashups, etc. Please let me know what you create!/p> p>Ben/p> p>a href="http://twitter.com/benlower">@benlower/a> | a href="mailto:phoneninja@microsoft.com?subject=Saw%20you%20on%20WPDev%20blog">phoneninja@microsoft.com/a> | +1 (206) 659-NINJA (6465)/p>div style="clear:both;">/div>img src="http://windowsteamblog.com/aggbug.aspx?PostID=576433" width="1" height="1">
Marketplace now open in 5 new markets
p>I"™m happy to report that the Windows Phone Marketplace is now officially open for business in 5 new markets around the world"”Argentina, Indonesia, Malaysia, Peru, and the Philippines. We can"™t wait to see all the great new apps you"™ll create and publish for customers there./p> p>a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2012/01/05/new-markets-for-windows-phone-developers.aspx">As I mentioned/a> a few weeks ago, if you"™d like your existing apps to reach Windows Phone owners in these new places, just log into App Hub and select them from the list"”or choose "worldwide" if you want your app to appear in all 41 of the markets Marketplace is now available in. (You"™ll need to do this even if you"™ve previously opted to make your app available globally.) a href="http://create.msdn.com/en-us/news/cross-submit-apps">Here"™s/a> a quick walkthrough./p> p>Just a reminder that apps submitted to the Marketplaces for Indonesia, Malaysia and China (which is accepting apps but not yet open to consumers) will be subject to additional requirements due to local laws, regulations, or norms. For more details, see the a href="http://msdn.microsoft.com/en-us/library/hh184842(v=VS.92).aspx">Application Certification Requirements/a>. If your app fails certification because of these additional requirements, you"™ll need to update and resubmit it, or uncheck the submission boxes for those markets./p> p>That"™s it for now. /p>div style="clear:both;">/div>img src="http://windowsteamblog.com/aggbug.aspx?PostID=575519" width="1" height="1">
Memory Profiling for Application Performance
p>Performance is a concern for all but the most trivial of applications, and in a constrained environment like the phone it is all the more so; performance issues directly manifest themselves in the user experience. Memory usage is one such source of performance issues that can degrade user experience, and the Windows Phone Marketplace enforces a a href="http://msdn.microsoft.com/en-us/library/hh184840(v=VS.92).aspx">technical certification requirement/a> that an application must not exceed 90 MB of RAM usage, except on devices that have more than 256 MB of memory./p> p>What could cause 90 MB of usage in a garbage-collected runtime? There could be several causes:/p> ul> li>Allocating too much./li> li>Long living objects that bloat working set./li> li>Holding on to references unintentionally leading to memory leaks./li> /ul> p>Applications allocating too much could end up with working sets breaching this threshold; applications with a large working set might eventually exit with an "Out of Memory" exception; and holding on to references unintentionally can lead to memory leaks causing working set to increase steadily and stealthily, eventually leading to the application exiting with an "Out of Memory" exception./p> p>Up until the Windows Phone SDK 7.1 release, application developers had to guard against this by programmatically instrumenting their code with specific framework method calls and track memory usage. These methods included the following:/p> ul> li>a href="http://msdn.microsoft.com/en-us/library/system.gc.gettotalmemory(v=vs.95).aspx">System.GC.GetTotalMemory/a>/li> li>a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.info.devicestatus.devicetotalmemory(v=VS.92).aspx">Microsoft.Phone.Info.DeviceExtendedProperties.DeviceTotalMemory/a>/li> li>a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.info.devicestatus.applicationcurrentmemoryusage(v=VS.92).aspx">Microsoft.Phone.Info.DeviceExtendedProperties.ApplicationCurrentMemoryUsage/a>/li> li>a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.info.devicestatus.applicationpeakmemoryusage(v=VS.92).aspx">Microsoft.Phone.Info.DeviceExtendedProperties.ApplicationPeakMemoryUsage/a>/li> /ul> p>But beyond that there was little help from the tools./p> p>The a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27570">Windows Phone SDK 7.1/a> addresses this through the introduction to a href="http://msdn.microsoft.com/en-us/library/hh202934(v=VS.92).aspx">profiling tools/a> to analyze the execution, visual, and memory characteristics of an application./p> p>Install the SDK now, and let us walk through the Memory Profiler as we investigate a case of a memory leak caused by unintentionally holding on to references./p> h1>A Sample Application/h1> p>Consider this a href="http://windowsteamblog.com/windows/m/files/575359/download.aspx">application/a> that has two pages, and where the second page renders several images within a grid, and where one may navigate between pages./p> p>Page2 has 4 images controls within a grid control that is i>bitmapcached/i>. During the initialization of Page2, it binds the 4 image controls to jpeg images and registers for an event handler./p> p>The two pages look as follows:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/3808.image_5F00_2FCA31C4.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/2376.image_5F00_thumb_5F00_034101DE.png" width="154" height="254" />/a> a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/6457.image_5F00_2CD4CD11.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/4375.image_5F00_thumb_5F00_062640C4.png" width="154" height="254" />/a>/p> p>As we try out the application going back and forth between the pages a few times, observe that memory usage keeps going up; there is a memory leak./p> h1>Visualizing the leak/h1> p>To delve deeper into this leak further let us run this application through the Memory Profiler using the following steps:/p> ol> li>Invoke the Profiler, choose "Memory (managed object allocation and texture usage)", and launch the application. Note the memory used by the application at the top of the screen./li> li>Click on Go To Page2. This will launch Page2, and display the 4 flower images./li> li>Click on the back button./li> li>Click on "˜Force GC"™. Note the memory used by the application at the top of the screen. Observe that it does not go down./li> li>Repeat steps 2, 3, 4 four more times./li> li>Now click on "˜Stop Profiling"™./li> /ol> p>We should see a graph like the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/5722.image_5F00_6EAB8C92.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/4617.image_5F00_thumb_5F00_6C225AD4.png" width="508" height="365" />/a>/p> p>As expected memory usage is steadily growing./p> h1>Analysis/h1> p>Select a range, from before the start of the first plateau to just after the after the start of the last plateau, for analysis. Once analysis is complete, using b>Performance Warnings/b> as the starting point, navigate to the b>Heap Summary /b>view. We should see a table similar to the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/5187.image_5F00_0294F95C.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/8524.image_5F00_thumb_5F00_74760A5E.png" width="508" height="365" />/a>/p> p>Note that the memory held by b>Retained Silverlight Visuals at End /b>is large as compared to that held by just managed objects. So, let"™s drill down into these retained Silverlight visuals./p> p>Select b>Retained Silverlight Visuals at End /b>and navigate to the b>Types /b>view. In the b>Types /b>view, sort the b>Total Size (Bytes) /b>column in descending order. We should now see a table similar to the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/6355.image_5F00_119BB269.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/1055.image_5F00_thumb_5F00_676C0480.png" width="508" height="365" />/a>/p> p>Note that Grid and Page2 are the heavy consumers. We also notice right away that 5 instances of Page2 are hanging around. In our scenario, we navigated 5 times to Page2, remember?/p> p>Let"™s look at what those 10 instances of the Grid are: click on the Grid and navigate to the b>Instances /b>view. We should now see a table similar to the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/2844.image_5F00_0B44B60E.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/2742.image_5F00_thumb_5F00_20DEEEAB.png" width="508" height="365" />/a>/p> p>Note that 5 of the instances are being allocated from Page2. Click on the hyperlink and you can go the line of code in XAML where the Grid is allocated./p> p>To see what is the memory being retained by the visual tree rooted at a Grid instance, click on, say, the grid with the ID 33 (this is a grid allocated from Page2), and navigate to the b>Visual Tree /b>view. We should now a table similar to the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/7180.image_5F00_249C937B.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/8880.image_5F00_thumb_5F00_48754508.png" width="508" height="365" />/a>/p> p>Note the visual tree rooted at that grid instance. We can see the 4 contained image controls, as well as the Texture memory associated with the grid.b>/b>/p> p>To cross check the association between the grid instance and Page2, we can go back to the Types view, select Page2, and navigate to the b>Instances /b>view. We should then see a table similar to the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/2818.image_5F00_2564D398.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/1715.image_5F00_thumb_5F00_226F6EE5.png" width="508" height="365" />/a>/p> p>Notice that there are 5 instances created and none of them has been destroyed (i.e. garbage collected)./p> p>Now let"™s look at the Visual Tree rooted at a Page2 instance. Select the first instance, and navigate to the b>Visual Tree/b>. We should see a table similar to the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/8535.image_5F00_718CB779.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/4718.image_5F00_thumb_5F00_0EB25F84.png" width="508" height="365" />/a>/p> p>Again, we see the grid, its associated texture memory, and its contained image controls. Earlier we saw that 5 instances of Page2 were hanging around. That leak was causing the associated grid, images, and texture memory to not get cleaned up./p> p>Now let us see why the Page2 instances were hanging around./p> p>Go back to the b>Instances /b>view, select the first Page2 instance, and navigate to the b>GC Roots /b>view. Collapse the tree structures. We should see a table similar to the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/7824.image_5F00_44D3D7D3.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/7536.image_5F00_thumb_5F00_61F97FDD.png" width="508" height="365" />/a>/p> p>Ignore the weak references (these do not prevent the GC from acting on the references). But look at the TouchFrameEventHandler; expand it and we should see a table similar to the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/4466.image_5F00_7F1F27E7.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/3276.image_5F00_thumb_5F00_4A3222AA.png" width="508" height="365" />/a>/p> p>There are 5 chained event handlers! The first one was allocated from our assembly. The rest were cloned within mscorlib, as each page appended its own TouchFrameEventHandler (the event handler is implemented as a .Net Delegate type). That event handler is holding a reference to the page that in turn is preventing the page from being garbage collected./p> p>So the eventhandlers references the Page2 instances, preventing it from being GC"™d; and thus assets contained in Page2 are not cleaned up (the grid, associated texture memory, images)./p> p>Solved!/p> p>All that remains to be done is to find where that handler is being registered in our assembly./p> p>Go back to b>Heap Summary/b>, select b>Retained Allocations at End/b>, navigate to the b>Types /b>view, sort by b>Type Name/b> column, and scroll down to locate the TouchFrameEventHandler. We should see the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/2117.image_5F00_550F03F2.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/1832.image_5F00_thumb_5F00_7CF20351.png" width="508" height="365" />/a>/p> p>To find out where that 1 instance was allocated in our application code, select the first entry, and navigate to the b>Methods /b>view. You should see the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/1738.image_5F00_193F4572.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/2781.image_5F00_thumb_5F00_2B3B6332.png" width="508" height="365" />/a>/p> p>Click on the b>Allocating Method /b>hyperlink, and you will jump to the method that did the allocation. You should see the following:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/3582.image_5F00_13547C0C.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/5102.image_5F00_thumb_5F00_57483A56.png" width="508" height="365" />/a>/p> p>There, right at the bottom is the place where we register to the eventhandler! The step of registering stashes away a strong reference to this instance of the page within the event handler delegate. Unless the user unregisters this handler, the Page2 instance will remain alive (and consequently so too will the grid and the images, and the texture memory will not get cleaned up)./p> p>If you comment out the line that enregisters the handler, and rerun this scenario, here is the graph you would see:/p> p>a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/6165.image_5F00_3B57055E.png">img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-53-84-metablogapi/4426.image_5F00_thumb_5F00_664EF363.png" width="508" height="365" />/a>/p> p>Voilà !/p> h1>Conclusion/h1> p>Having a garbage collected runtime removes one of the biggest sources of program errors, memory allocation errors; you no longer have to worry about freeing memory which you no longer use. But leaks spring when you unintentionally hold on to object references that you no longer use. By providing a variety of Views on the applications memory usage the Memory Profiler can be a valuable tool to detect and fix such leaks./p>div style="clear:both;">/div>img src="http://windowsteamblog.com/aggbug.aspx?PostID=575395" width="1" height="1">
BAOC Countdown and WPAppItUp Wrap-Up
p>b>Big App on Campus: Two Weeks Left!/b>/p> p>Back in November, we a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/11/18/do-you-have-what-it-takes-to-be-the-big-app-on-campus.aspx">announced/a> a developer promotion for US students called "Big App on Campus." There are exactly 18 days left to enter. Though we think it"™s a no brainer, some of you have asked "Why should I enter?" Let"™s recap:/p> p>1. b>For the experience of a lifetime/b> -> 10 finalists, along with one of their friends, will win a trip to SxSW in March. If selected as a finalist, you and your friend will get to come hang out with a href="http://www.thegraciousfew.com/">The Gracious Few/a> (featuring members of the bands a href="http://youtu.be/FNrQOUtXYOo">LIVE/a> and a href="http://youtu.be/JWhXyNL74yI">Candlebox/a>) and attend a rocking concert./p> p>2. b>$30k in prize money/b> -> the top paid app and the top free app will each win $15,000!/p> p>em>3. /em>b>Serious bragging rights/b> -> finalist apps will be featured on our Facebook page and the developers behind these creations will have some crazy stories to tell about their time in Austin at SxSW.em>/em>/p> blockquote> p>em>font size="2"><aside reason="toAppeaseTheLawyers">No Purchase Necessary. Open only to US university students 18+ who are legal residents of the U.S. and D.C. Submissions due 02/14/2012 and game ends 03/13/2012. For Official Rules, click /font>/em>a href="http://www.microsoft.com/student/bigapponcampus/">em>font size="2">here/font>/em>/a>em>font size="2"></aside>/font>/em>/p> /blockquote> p>All Windows Phone applications published since August 1, 2011 are eligible for entry. However all apps must be published to the Marketplace by February 14sup>th/sup>. Make your Valentine proud and a href="http://www.zoomerang.com/Survey/WEB22DP5BYJKZH/">enter/a> your app today "“ I"™m sure she/he won"™t mind helping you spend the $15k in winnings up for grabs. Check out our Facebook a href="http://www.facebook.com/MicrosoftTechStudent?sk=app_269100103148944">page/a> for all details and information on how to get started on building your first, or next, Windows Phone app./p> p>b> /b>/p> p>b>#WPAppItUp Wrap-Up/b>/p> p>Starting back in October, we challenged students to create Sketchflow prototypes of their app ideas for Windows Phone. I"™m happy to announce the full list of winners:/p> p>a href="http://www.twitter.com/cbarretopy">@cbarretopy/a>/p> p>a href="http://www.twitter.com/simzzdev">@simzzdev/a>/p> p>a href="http://www.twitter.com/m_naveed4u">@m_naveed4u/a>/p> p>a href="http://www.twitter.com/sp990">@sp990/a>/p> p>a href="http://www.twitter.com/gowtham1337">@gowtham1337/a>/p> p>a href="http://www.twitter.com/3xdev">@3xdev/a>/p> p>a href="http://www.twitter.com/utebolatas">@utebolatas/a>/p> p>a href="http://www.twitter.com/sakarshkumar">@sakarshkumar/a>/p> p>a href="http://www.twitter.com/sriharsha_63">@sriharsha_63/a>/p> p>a href="http://www.twitter.com/luciomsp">@luciomsp/a>/p> p>Congratulations to all the winners!/p> p>Ben/p> p>a href="http://twitter.com/benlower">@benlower/a> | a href="mailto:phoneninja@microsoft.com?subject=Saw%20you%20on%20WPDev%20blog">phoneninja@microsoft.com/a> | +1 (206) 659-NINJA (6465)/p>div style="clear:both;">/div>img src="http://windowsteamblog.com/aggbug.aspx?PostID=575282" width="1" height="1">

-
WP 7.5 Overview for Developers
On Demand -
Building WP 7.5 Apps with Visual Studio 2010
On Demand -
Building WP 7.5 Apps with Silverlight
On Demand -
WP 7.5 App Switching. Tombstoning and Multitasking
On Demand -
Live Tiles and Push Notifications
On Demand -
Building Games for WP 7.5 (XNA)
On Demand -
Monetizing a Windows Phone 7.5 App
On Demand -
Cloud + Mobile Game - Build Rock Paper Azure on Windows Phone
Online Event
Tuesday, December 13, 2011 9:00 AM PST'


Bryson Ewell
This young developer was inspired by his big brother. Find out how he learned to program and why you wont be seeing skydiving Sasquatches anytime soon...
Read More
This young developer was inspired by his big brother. Find out how he learned to program and why you wont be seeing skydiving Sasquatches anytime soon...
Read More





















