You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My guess is that the variable has been garbage-collected prior to you expanding it. Calling inspect() won't prevent an object from being collected, and the expansion in the debug console is done lazily. If the variable went out of scope and got collected, there's no way to show its data.
As a workaround if you want to inspect variables that would usually be collected, you could (temporarily) add them to a top-level/static List or something (though be sure not to leave that in non-debug code!).
If you can reproduce this on something that you don't think should've been collected, please provide a code sample and I'll try to reproduce. Thanks!
If you've declared the variable locally inside any block, try to change it to a higher scope.
I've declared the variable along with other class members and now the issue is gone.
Activity
DanTup commentedon Sep 8, 2020
My guess is that the variable has been garbage-collected prior to you expanding it. Calling
inspect()won't prevent an object from being collected, and the expansion in the debug console is done lazily. If the variable went out of scope and got collected, there's no way to show its data.As a workaround if you want to inspect variables that would usually be collected, you could (temporarily) add them to a top-level/static
Listor something (though be sure not to leave that in non-debug code!).If you can reproduce this on something that you don't think should've been collected, please provide a code sample and I'll try to reproduce. Thanks!
ajain-bst commentedon Sep 8, 2020
Understood! Thanks for the quick response @DanTup :)
Closing this.
amalmohann commentedon Apr 8, 2022
If you've declared the variable locally inside any block, try to change it to a higher scope.
I've declared the variable along with other class members and now the issue is gone.