You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Add-In/.NET Memory Management

Received Response
16
Views
1
Comments
edited Aug 6, 2019 4:35PM in UI Extensibility 1 comment

Summary

Best practices on how to reduce memory use and prevent memory leaks in .NET applications

Content

High memory usage and memory leaks in your Add-ins can have severe detrimental effects on the performance of the Server Console. Here are best practices for .NET Memory Management. None of these best practices are specific to Oracle Service Cloud Add-in code – they apply to all types of .NET applications.

Implement IDisposable if your class:

1. Subscribes to an event longer lived than the instance of your class. For example:

public static class Context
{
   // ...
   public static class Events
   {
       public static event EventHandler ToastClicked;
   }
}

public class ToastController
{
   // ...
   public ToastController
   {
       Context.Events.ToastClicked += Notification_ToastAccept;
   }
   // TODO implement IDisposable. In Dispose unsubscribe from Context.Events.ToastClicked.
}

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!