.NET Memory Management with dotMemory

Jason Schmidtlein .NET, .NET Core, Problem Solving, Technology Snapshot Leave a Comment

Given the maturity of the .NET Framework and the automated nature of its memory management, many developers are guilty of glossing over (or even outright ignoring) whether their code is optimal in terms of CPU and memory usage. Personally, I have caught myself making sure my code is maintainable, testable, and extendable while forgetting to consider memory management in terms of nonfunctional aspects.

While the .NET runtime does a great job and memory corruption is extremely rare, we should still be concerned with memory management, particularly in large-scale .NET base applications.

This concern isn’t limited to on-premise applications. It’s easy to forget about memory usage with cloud computing. Azure Functions and AWS Lambda have billing structures based upon the average memory size per second of function execution. The direct correlation between memory usage and cost couldn’t be more transparent.

Fortunately, there are many great tools to help profile and analyze your memory footprint. JetBrains has a fantastic tool called dotMemory which makes it easy to profile processes, auto detect issues, perform deep analysis, and determine traffic. dotMemory can be installed as either a stand-alone tool or as a part of the ReSharper package integrated into Visual Studio.

In this post, we’ll show how to use dotMemory to generate a memory profile and analyze a memory leak in a .NET Core application.

Create your own web bots in .NET with CEFSharp!

Matt Cunningham .NET, JavaScript, Programming, Tutorial Leave a Comment

Have you ever wanted to create an automated way to load, manipulate, and then act upon a web page?

Using CEFSharp (and some strategic JavaScript), you can create headless (no GUI) interfaces of Chrome’s parent browser, Chromium, and then instruct them to do pretty much anything a web browser can do.

This is a tutorial about using CEFSharp to accomplish some basic web functions with simple examples. We’ll create three automated bots that can simulate user web interaction and programmatically react to browser events using CEF and the CEFSharp library. You can follow along by copying the code provided or by downloading…

Using Dapper Flexibly

Jason Schmidtlein .NET, Problem Solving, Technology Snapshot 1 Comment

Dapper is a micro ORM (Object Relational Mapper) for .NET that is nearly as fast as using a raw ADO.NET data reader. It is a great alternative to Entity Framework, especially when performance is a top priority and you don’t need all the features of a “heavy” ORM.

In this post, I will provide an example of creating a generic CRUD repository that leverages the performance of Dapper while providing flexibility for a multitude of scenarios..

Into the Core

James Bradley .NET, .NET Core, ASP.NET, Technology Snapshot, Tutorial Leave a Comment

The client I’m currently assisting has begun to move applications from more monolithic architecture into a more modern, cloud-based architecture. The organization is a bit of a .NET anomaly in that it is a company that’s primarily Java, yet has some .NET.

So even though Microsoft has a list of framework tools (such as Azure Service Fabric and Azure App Service), it’s fair to say that asking a primarily Java-focused company to use those tools could be an uphill battle. This is where .NET Standard and .NET Core have come to the rescue.

I work with a ton of smart people and I’m pretty amazed at how fast they can pick up on things from reading. I, however, cannot really understand it fully until I touch it. So let’s build a quick RESTful Web API step by step to see how challenging it is. We’ll be using .NET Standard, .NET Core, and ASP.NET Core.

Getting Started with Xamarin.Forms and Azure Mobile App Service

Jeff Hopper .NET, Azure, Mobile, Technology Snapshot, Tutorial, Xamarin 2 Comments

Earlier this month my friend Ryan introduced us to Getting Started with Xamarin Forms and Prism. In that post, Ryan started a mobile application to display blog posts which he called SimpleBlog.

In this article, I would like to continue that demonstration by adding a back-end server to persist and share these blogs. This will be accomplished using Azure’s Mobile App Service which falls within its free tier services.

Yes, you did read that right: you can spin up an Azure account and have access to try out many of Azure’s features. For instance, the example I am going to walk you through today can be hosted indefinitely without costing you anything, and to that, you could add nine more web, mobile, or API services. See https://azure.microsoft.com/en-us/free/ for more information.

There is no way I am going to be able to cover all the possibilities available in an Azure Mobile App service, much less what Azure has to offer. My intent in this post is to help “whet your appetite” on the possibilities by giving a quick overview of just two great frameworks that play great together: the Microsoft.Azure.Mobile.Client mobile framework tied to an Azure Mobile Apps Service….