1. Keep the message and context before restarting
Stop adding tasks to the queue. Write down the exact text of the error, the file or query involved, the number of items processed together and the stage reached. Was the model loading, was the computation progressing or was the output being written? Keep the settings in a note and the already completed results in their folder.
A frozen screen or an application closing without explanation isn't enough to identify the cause. Find its log when one exists. A connection failure, an invalid input and saturated memory can produce similar symptoms in the interface. If the software says nothing, write "cause undetermined" and prepare a minimal test rather than inventing a diagnosis.
2. Separate GPU memory, system memory and disk space
GPU memory is used for the computation elements on the card. Server RAM and storage serve other needs. The capacities shown on BriefGPU GPU listings don't describe the RAM or disk actually available. Check the resource mentioned in the message and the information about your environment.
In Python, MemoryError indicates a memory allocation failure; that name alone doesn't indicate a lack of VRAM. The ENOSPC code corresponds to a lack of space on the target device. These markers guide the search, but the application log is still needed to locate the operation.
| Observation | First check | What a bigger GPU doesn't solve on its own |
|---|---|---|
| CUDA out of memory message during computation | Card memory in use, other tasks and batch size | A software incompatibility or a corrupted file |
| MemoryError while reading files | Process memory, amount of data loaded into RAM | Loading the entire folder into system memory |
| No space left on device during an export | Space and possible quota of the output or temporary folder | A full disk or a storage limit |
| Application closed without a usable message | Log, stage reached and test on a single input | A still unknown cause |
3. Go back to one input and a single active job
First check the processes you started yourself. A preview, an old session or a second tool may still be running. Close tasks that are no longer needed properly after saving their state. Don't kill a process you don't recognize and don't restart the whole environment to save a few minutes of diagnosis.
Retry the input that failed, on its own, without reducing its quality. If it passes in isolation but fails in a batch, the number of simultaneous items becomes a lead. For example, reduce a batch of four to two, then to one if necessary. The number of files in the folder stays the same; only the amount processed at the same time changes.
Some tools offer sequential processing to limit memory spikes. Diffusers in particular documents splitting the decoding of a batch of images. This option depends on the pipeline used: check its options before enabling a setting found for another model.
4. Reduce the load without losing the requested result
If a single input fails, examine its dimensions or length. For an image, going from 2,048 × 2,048 to 1,024 × 1,024 divides the number of pixels by four. That doesn't guarantee total memory divided by four: the model and other elements keep their own needs. A reduction is only acceptable if the output retains the necessary details.
For an assistant, distinguish the documents provided, the question, and the generated answer. The generation cache can consume more memory with a long context; the exact mechanisms depend on the model. Test a shorter request or a single query at a time. Do not remove the passage that contains the answer and then conclude that the problem is solved.
Always keep the original input. Name the trial variant and write down what it changes. If the tool offers tiling or offloading certain elements to RAM, check its documentation and verify the seams, quality, and observed time. A VRAM-saving option can move the constraint elsewhere.
5. Don't confuse reserved memory with usable memory
With PyTorch, the memory reserved by the allocator and the memory occupied by tensors are two different measurements. Clearing the unused cache does not free tensors that are still active. So a cleanup command does not turn an oversized workload into a compatible one.
If a clean restart of your application helps, then replay the same small case and note the result. A success after restart does not by itself prove that a memory leak has been fixed. If usage increases with each identical run, keep that observation and consult the software's documentation or support before piling on more restarts.
Example: isolating the problem in a folder of twelve images
Here is an illustrative scenario, without any hardware measurements. A freelancer prepares twelve images, two of which have large dimensions and fine text. Batch processing in groups of four fails. She keeps the message, then tries one of the large images alone, at the original quality. The table shows how to interpret possible observations.
In this scenario, she adopts groups of two only after checking both large images together and a few ordinary images. She verifies the text and edges in the exported files. She does not generalize this result to all image sizes, all models, or other software.
| Scenario trial | Hypothetical observation | Local decision |
|---|---|---|
| Four images simultaneously | Memory failure | Keep the error and reduce the group size |
| One large image, same settings | Complete and acceptable output | The target quality can pass for this isolated case |
| Two large images together | Complete and acceptable outputs | Test this group on a short run |
| Heavily reduced image | Computation finished, text illegible | Reject this reduction despite the technical success |
When another capacity becomes a justified lead
Compare another card when the lack of GPU memory is identified, when the essential case fails on its own, and when reductions compatible with your quality are not enough. Keep the relevant software, version, settings, and input: this record makes the next trial comparable. It does not allow you to deduce exactly how many extra GB will suffice.
An error when loading the model can also limit the value of reducing the group size: a significant part of the load exists before the first input. Precision or quantization options change the execution conditions and sometimes the results; they require a separate trial. Adding batches does not automatically unify the memory of several cards.
Finish with a usable diagnosis
Your output note fits in five elements: message and step, suspected resource, input kept, setting that passes or fails, quality check performed. Add what remains unknown. If no small case works, stop repeating the full batch and ask for help with this information.
Do not delete your only originals to free up disk space, do not lower several parameters at once, and do not count a partial output as a success. Set aside time to back up valid results. The diagnosis should reduce uncertainty; it does not need to turn into an endless tuning session.