Joined 19.03.2020
Unsubscribe from events - Any benefits ?
28 Feb 2023, 11:28
Hello,
I wonder if unsubscribing from events can have an impact in performance (e.g.: reduce RAM usage).
It is not that easy to manage cAlgo methods when you don't really know how these manage memory resources.
Is there any documentation about this?
Thank you.
Replies
Algo_Invest
01 Jun 2023, 19:20
Hi firemyst,
At that time I made some research on this, however, what I wanted to know is how this is managed internally by cAlgo.
Nonetheless, at this stage I am more than aware that performance issues have nothing to do with my code.
@Algo_Invest


firemyst
01 Jun 2023, 06:00
This is more a C# thing than a cTrader thing.
If you unsubscribe from events, it could free up some resources and make available for garbage collection.
Do a little Google research.
https://stackoverflow.com/questions/506092/is-it-necessary-to-explicitly-remove-event-handlers-in-c-sharp#:~:text=Yes%2C%20you%20will%20want%20to,reference%20remains%2C%20it%20is%20live.
@firemyst