Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Cross-Platform Development with Xamarin

You're reading from   Mastering Cross-Platform Development with Xamarin Master the skills required to steer cross-platform applications from drawing board to app store(s) using Xamarin

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher
ISBN-13 9781785285684
Length 390 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (14) Chapters Close

Preface 1. Developing with Xamarin FREE CHAPTER 2. Memory Management 3. Asynchronous Programming 4. Local Data Management 5. Networking 6. Platform Extras 7. View Elements 8. Xamarin.Forms 9. Reusable UI Patterns 10. ALM – Developers and QA 11. ALM – Project and Release Management 12. ALM – App Stores and Publishing Index

Patterns and best practices

While dealing with managed runtime and garbage collection, there are certain patterns and anti-patterns developers must be careful with. If not handled properly, both managed and native objects can produce noncollectable traces, which in turn can cause memory leaks and unnecessary resource consumption.

Disposable objects

The resources managed by the garbage collector are generally limited to memory allocations. Other resources like network sockets, database handles, UI elements, and file/device descriptors need to have additional definitions or mechanisms.

In managed runtime, these object resources can be cleaned up in two different ways. The first, less efficient, unpredictable way is to implement a destructor/finalizer. With a finalizer implementation, once the garbage collector decides the object is no longer strongly reachable, the resources such as network sockets can be disposed. However, finalizable objects have to wait for the following GC cycle to be cleaned...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image