Does Colab preserve /content files after an idle-triggered runtime recycle?
0 reputation · 21 Feb 2025, 08:31 UTC
Goal
I need to know whether a Google Colab free-tier runtime preserves files written to /content after the backend disconnects the VM for inactivity and the user reconnects through the browser.
Constraints and uncertainty
Colab behavior is generally described as ephemeral: hosted VMs are recycled after idle periods and local filesystem state is cleared, but Google does not publish a fixed idle timeout or an explicit resume guarantee. GPU assignment is best-effort and can be preempted. Because behavior can vary by region, account tier, and current load, a single observed reconnect is not reliable evidence.
What exactly happens to /content and mounted Drive paths after an idle disconnect? Does Colab automatically remount Drive on reconnect, and is there any supported way to detect whether the runtime reused the previous VM or provisioned a new one?