Udemy
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Development
Web Development Data Science Mobile Development Programming Languages Game Development Database Design & Development Software Testing Software Engineering Development Tools No-Code Development
Business
Entrepreneurship Communications Management Sales Business Strategy Operations Project Management Business Law Business Analytics & Intelligence Human Resources Industry E-Commerce Media Real Estate Other Business
Finance & Accounting
Accounting & Bookkeeping Compliance Cryptocurrency & Blockchain Economics Finance Finance Cert & Exam Prep Financial Modeling & Analysis Investing & Trading Money Management Tools Taxes Other Finance & Accounting
IT & Software
IT Certification Network & Security Hardware Operating Systems Other IT & Software
Office Productivity
Microsoft Apple Google SAP Oracle Other Office Productivity
Personal Development
Personal Transformation Personal Productivity Leadership Career Development Parenting & Relationships Happiness Esoteric Practices Religion & Spirituality Personal Brand Building Creativity Influence Self Esteem & Confidence Stress Management Memory & Study Skills Motivation Other Personal Development
Design
Web Design Graphic Design & Illustration Design Tools User Experience Design Game Design Design Thinking 3D & Animation Fashion Design Architectural Design Interior Design Other Design
Marketing
Digital Marketing Search Engine Optimization Social Media Marketing Branding Marketing Fundamentals Marketing Analytics & Automation Public Relations Advertising Video & Mobile Marketing Content Marketing Growth Hacking Affiliate Marketing Product Marketing Other Marketing
Lifestyle
Arts & Crafts Beauty & Makeup Esoteric Practices Food & Beverage Gaming Home Improvement Pet Care & Training Travel Other Lifestyle
Photography & Video
Digital Photography Photography Portrait Photography Photography Tools Commercial Photography Video Design Other Photography & Video
Health & Fitness
Fitness General Health Sports Nutrition Yoga Mental Health Dieting Self Defense Safety & First Aid Dance Meditation Other Health & Fitness
Music
Instruments Music Production Music Fundamentals Vocal Music Techniques Music Software Other Music
Teaching & Academics
Engineering Humanities Math Science Online Education Social Science Language Teacher Training Test Prep Other Teaching & Academics
AWS Certification Microsoft Certification AWS Certified Solutions Architect - Associate AWS Certified Cloud Practitioner CompTIA A+ Cisco CCNA Amazon AWS CompTIA Security+ AWS Certified Developer - Associate
Photoshop Graphic Design Adobe Illustrator Drawing Digital Painting InDesign Character Design Canva Figure Drawing
Life Coach Training Neuro-Linguistic Programming Mindfulness Personal Development Meditation Personal Transformation Life Purpose Neuroscience Emotional Intelligence
Web Development JavaScript React CSS Angular PHP WordPress Node.Js Python
Google Flutter Android Development iOS Development Swift React Native Dart Programming Language Mobile Development Kotlin SwiftUI
Digital Marketing Google Ads (Adwords) Social Media Marketing Google Ads (AdWords) Certification Marketing Strategy Internet Marketing YouTube Marketing Email Marketing Retargeting
SQL Microsoft Power BI Tableau Business Analysis Business Intelligence MySQL Data Analysis Data Modeling Data Science
Business Fundamentals Entrepreneurship Fundamentals Business Strategy Online Business Business Plan Startup Freelancing Blogging Home Business
Unity Game Development Fundamentals Unreal Engine C# 3D Game Development C++ 2D Game Development Unreal Engine Blueprints Blender
30-Day Money-Back Guarantee
Development Programming Languages C#

C# Memory Tricks: Learn How To Master The Garbage Collector

This course teaches you advanced C# memory management tricks that every professional .NET developer must know.
Rating: 4.5 out of 54.5 (772 ratings)
5,406 students
Created by Mark Farragher
Last updated 9/2019
English
English [Auto]
30-Day Money-Back Guarantee

What you'll learn

  • Learn how the Garbage Collector works
  • Master .NET memory optimization
  • Discover the truth about finalizers
  • Learn how to measure the memory footprint of your code
  • The unexpected memory footprint of List resizing
  • Structs versus classes - which one is better?
  • What assumptions does the GC make about object size and lifetime?
  • Manual deallocation with the Dispose pattern
  • ... and much more!
Curated for the Udemy for Business collection

Course content

5 sections • 28 lectures • 3h 35m total length

  • Preview04:12
  • Preview03:50
  • Introduction To .NET Memory Management
    04:17
  • Preview03:19
  • Background Info - About Me
    01:14

  • Section Introduction
    00:43
  • The Stack
    05:23
  • The Heap
    04:59
  • Value Types
    05:42
  • Reference Types
    05:29
  • Preview06:04
  • Section Recap
    02:55

  • Section Introduction
    01:48
  • Garbage Collection In .NET
    16:46
  • How To Optimise Your Code For Garbage Collection
    18:20
  • Finalisers in .NET
    17:11
  • Preview16:34
  • Section Recap
    04:07
  • Garbage Collection
    10 questions

  • Section Introduction
    01:19
  • Avoid Boxing And Unboxing
    11:50
  • Do Not Concatenate Strings
    16:09
  • Use Structs Instead Of Classes
    17:55
  • Preview12:30
  • Avoid Calling ToList In LINQ Expressions
    18:04
  • Can We Modify Strings Directly?
    04:25
  • Section Recap
    03:52
  • Memory Allocation Tricks
    10 questions

  • Course Recap
    01:44
  • Bonus Lecture
    04:55

Requirements

  • You need a Windows, Mac or Linux laptop with Microsoft Visual Studio, Xamarin Studio or Monodevelop
  • You should be a beginner, intermediate, or advanced C# developer
  • That's it!

Description

Last updated: November 17th, 2017 - Added new promo video

Modern computers have loads of memory. But it's very easy to burn through it all in seconds if your code is not efficient about allocating and using memory.

Did you know that one simple mistake can make your code allocate 1600 times more memory than absolutely necessary?

Don't be 'that developer' who keeps crashing the development server with an OutOfMemory exception!

And you certainly don't want to be responsible for inflating the hardware budget. Can you imagine having to explain to your team that 512 GB of memory is not enough to run your code on the production server?

Let me help you.

It doesn't have to be like this. If you have a good understanding of the garbage collection process and follow a few simple best practices, you can dramatically reduce the memory footprint of your code.

Sound good?

In the last 10 years I have learned the secrets of garbage collection in .NET, and in this course I am going to share them all with you.

In a series of short lectures I will take a detailed look at the garbage collection process. I will show you all of the memory allocation problems you can expect when writing C# code, like unexpected boxing, string duplication, collection resizing, and more. I'll teach you quick and easy strategies to resolve these problems.

By the end of this course you will be able to master the garbage collector.

Why should you take this course?

You should take this course if you are a beginner or intermediate C# developer and want to take your skills to the next level. Garbage collection and memory management might sound complicated, but all of my lectures are very easy to follow and I explain all topics with clear code and many instructive diagrams. You'll have no trouble following along.

Or maybe you're working on a critical section of code in a C# project, and need to make sure your memory usage is as efficient as possible? The tips and tricks in this course will help you immensely.

Or maybe you're preparing for a C# related job interview? This course will give you an excellent foundation to answer any questions they might throw at you.

30 day money-back guarantee

This course comes with an unconditional, Udemy backed, 30-day money-back guarantee. If you are dissatisfied with the course for any reason, simply request a refund and get your full purchase amount back, no questions asked.

Who this course is for:

  • Beginner, intermediate, and advanced C# programmers who want to learn how to master the garbage collector.
  • Developers who are about to take a job interview and need to prepare for questions about memory allocation in .NET
  • Professionals who are writing a section of mission-critical code in a large C# project

Instructor

Mark Farragher
Microsoft Certified Trainer
Mark Farragher
  • 4.3 Instructor Rating
  • 8,286 Reviews
  • 39,582 Students
  • 12 Courses

Mark Farragher is a blogger, investor, serial entrepreneur, and the author of 11 successful IT courses on Udemy and other marketplaces. His career spans over two decades during which Mark has been a Founder twice and CTO three times, and has launched two lean startups in The Netherlands.

Mark became a Microsoft Certified Trainer in 2005 and started training classes in .NET development, web design, and Microsoft back-office servers. Today he uses his extensive knowledge of IT to help CTO’s, architects, and other tech professionals with their leadership, communication, and technical skills.

Mark has MCSA and MCSD certifications from Microsoft and is a certified Microsoft Trainer and Scrum master. He speaks fluent English, Dutch, and German.

  • Udemy for Business
  • Teach on Udemy
  • Get the app
  • About us
  • Contact us
  • Careers
  • Blog
  • Help and Support
  • Affiliate
  • Terms
  • Privacy policy
  • Cookie settings
  • Sitemap
  • Featured courses
Udemy
© 2021 Udemy, Inc.