1. A method, comprising: obtaining time-series virtual machine (VM) data including garbage-collection (GC) data collected during execution of a virtual machine in a computer system; computing, by a processor, a time window for analyzing the time-series VM data based at least in part on a working time scale of high-activity patterns in the time-series VM data, wherein the time window is computed by multiplying the working time scale by an average time between bursts from a series of high-activity events in the time-series VM data; using a trend-estimation technique to analyze the time-series VM data within the time window to determine an out-of-memory (OOM) risk in the virtual machine; and storing an indication of the OOM risk for the virtual machine based at least in part on determining the OOM risk in the virtual machine.