Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reference count watch

Please suggest a way to print reference count of some object references in brightscript without halting the application.
0 Kudos
Roku Employee
Roku Employee

Re: Reference count watch

Currently there isn't any way to get or print object reference counts programmatically.

In case it is helpful, e.g. for development leak monitoring, you can get a total object count from RunGarbageCollector().

Note that if you stop or break into the BrightScript debugger, there are some commands to get information.
'var' shows local variables including ref count, 'bsc' shows an anonymous listing of objects including ref count, and 'bscs' (on firmware 6.1 or later) shows a summary of object counts by type.
0 Kudos