Are you collecting results, e.g. losses, and storing them in a list or something similar? If you are, make sure you store graph-detached copies of the relevant tensors by calling Tensor.detach 11.
losses = []

# Inside training loop or similar
loss = criterion(...)
losses.append(loss.detach())

If you store tensors attached to a graph, invoking garbage collection will have no impact since those tensors are still actively referenced via the list.