07-14-2017 05:16 PM - edited 07-14-2017 05:42 PM
I don't usually use named queues or notifiers, but it seemed convenient for a recent task to use named notifiers. My program would use the named notifier once every 10 mins, and after a couple days of running, the program would get a memory error. I cannot prove the memory error is from the notifiers in the program so I made a simple test case, attached.
I made "Notifier Test.vi" to send data on a named notifier every 5ms, but only a single notifier should ever be created. If I run the "Notifier Test.vi", the memory usage starts out constant, then starts to trend upward in a straight line after about 5 minutes. After about 30 minutes of running, the notifier no longer transfers data and the data indicator just reads 0. You can use the included "Check Memory Usage.vi" to see a chart of the memory usage over time.
Can anyone reproduce these results? Did I misunderstand how named notifiers work?
Block diagram for those who don't want to download:
Solved! Go to Solution.
07-14-2017 05:27 PM - edited 07-14-2017 05:32 PM
This is not a bug, rather the expected behavior. Each time you obtain a notifier (even a named one, where you're pointing at the same underlying notifier), you get a new copy of the reference, and every single one of those needs to be closed. So, if you obtain a reference in a loop (as you're doing), but you never close those references, then you get a resource leak.
EDIT: here's one of many posts on this topic, this one from an authoritative source:
https://forums.ni.com/t5/LabVIEW/Obtain-Queue-memory-leak/m-p/1644744#M590534
07-14-2017 05:36 PM
I see, thanks for clearing that up!