diff --git a/package/AUTHORS b/package/AUTHORS index c8ba87c062..073850e649 100644 --- a/package/AUTHORS +++ b/package/AUTHORS @@ -285,6 +285,7 @@ Chronological list of authors - Apoorva Verma - Aryaman Chaudhri - Francesco Siciliani + - Erik Fransson External code ------------- diff --git a/package/CHANGELOG b/package/CHANGELOG index 45647f3904..1f7546cdc6 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -18,13 +18,18 @@ The rules for this file: spyke7, talagayev, tanii1125, BradyAJohnston, hejamu, jeremyleung521, harshitgajjela-droid, kunjsinha, aygarwal, jauy123, Dreamstick9, ollyfutur, Amarendra22, charity-g, ParthUppal523, apoorva-01, RMeli, - raulloiscuns, Aryaman-Chaudhri, sici17 + raulloiscuns, Aryaman-Chaudhri, sici17, erikfransson * 2.11.0 Fixes * Mass (u) has been added to MDAnalysis base units and clarified that physical constants use CODATA 2010 values (Issue #3944, PR #5439) + * The NCDF reader now releases the pages of the memory map once a frame has + been read into the Timestep. Reading a netCDF trajectory with `mmap=True` + (the default for a file name) no longer grows the resident memory of the + process towards the size of the whole trajectory file. Requires a platform + that provides `MADV_DONTNEED`, i.e. not Windows (Discussion #4792). * Added `.gitattributes` to enforce LF (\n) as line endings and renormalized existing files to conform (Issue #5315, PR #5446) * `AtomGroup.rotate()` and the `rotateby` trajectory transformation now diff --git a/package/MDAnalysis/coordinates/TRJ.py b/package/MDAnalysis/coordinates/TRJ.py index e9799e4d94..6687093651 100644 --- a/package/MDAnalysis/coordinates/TRJ.py +++ b/package/MDAnalysis/coordinates/TRJ.py @@ -134,6 +134,7 @@ import warnings import errno import logging +import mmap from math import isclose import MDAnalysis @@ -675,6 +676,10 @@ def _read_frame(self, frame): self.convert_pos_from_native(ts.dimensions[:3]) ts.frame = frame # frame labels are 0-based self._current_frame = frame + # the frame is now copied into ts, so its pages can be dropped again + mm = getattr(self.trjfile, "_mm", None) + if mm is not None and hasattr(mmap, "MADV_DONTNEED"): + mm.madvise(mmap.MADV_DONTNEED) return ts def _reopen(self):