del app when session destroyed

Couldn’t find a standardized appropriate way in doc:

using bokeh serve, when session is destroyed (“on_session_destroyed” in server_lifecycle.py is called),

what is the correct pattern to destroy the app instantiated in main.py, so to free resources (memory, sql connections, etc.)

Any suggestions ? that would be really great !