How can I verify that a widget updates only when it's visible? I've installed a task manager widget that shows me the amount of free memory I currently have in the icon of the widget. When I look at it it updates every ~3 seconds, so it definitely drains some battery and consumes some memory when it's active and updating.

I want to make sure it doesn't update when the widget is invisible:


When screen is turned off.
When another app is running.
When widget is placed on another (invisible) home screen tab.


How can I check whether the widget updates only when it's visible or even when it's invisible?
It doesn't update only when it's visible. Because all widgets are drawn by the host (i.e. the home screen or lock screen), there's no way for the widget provider to tell whether the widget is visible or not.

It would be possible for the service that keeps changing the widget to find out when the screen is turned off. In recent Android versions, you could verify that using the Battery screen in Settings. Add the widget to your home screen, then (while the phone/tablet isn't plugged in) leave the screen turned off for some time. Turn it back on, and see if your task manager app is listed on the Battery screen.

Regardless of the result, your task manager app is probably doing more harm than good. Android isn't like Windows: it's designed to keep as much memory in use as it can, and only frees memory when it has to. See Do I really need to install a task manager? for more info.