Because it came up in another thread, it seems worth of discussion.
http://www.city.medicine-hat.ab.ca/modules/showimage.aspx?imageid=1130
Many of you might have experienced it. The more modern plugins you use, the more a framerate stutter slips into your patch. Since the the migration to c# started, more of that is occurring.
This happens because of the way memory is managed in .net and hence in c#. You can easily create objects of all kinds and never worry about removing them. This is done by quiet helper in the background: the garbage collector.
The existence of the gc is certainly a great feat of computer science and it helps development a tremendous amount. However, his workings are hard to control, and he is doing his dirty work whenever, and usually quite intense. This can really mess with the smooth real time experience we ask of vvvv.
So this thread is about exchanging ideas on what to do about it.
The first clues I found are:
- as a plugin dev use structs instead of objects, because then the gc is circumvened (unless of course your structs have inner objects with a lot of change).
- setting your MainLoop (VVVV) to Filter sometimes seems to make the problem even more visible.
But I also have questions:
Is there any best practise I can do as a plugin developer to make it more stable?
Is there any good source to learn more about c# realtime development regarding this issue?
What is the devvvvs stance on the topic, do you have any ideas how to contain the stutter?
And not least, how could a patcher go on finding the culprit plugin that feeds to the heap of the gc?