Skip to content

Commit 3c65f93

Browse files
committed
* Call Pointer.trimMemory() on FFmpegFrameGrabber/Filter/Recorder close to reclaim system memory on Linux (issue #2334)
1 parent 8d8af6b commit 3c65f93

4 files changed

Lines changed: 4 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
* Call `Pointer.trimMemory()` on `FFmpegFrameGrabber/Filter/Recorder` close to reclaim system memory on Linux ([issue #2334](https://github.com/bytedeco/javacv/issues/2334))
23
* Add `FrameRecorder.videoProfile` property ([pull #2361](https://github.com/bytedeco/javacv/pull/2361))
34
* Upgrade dependencies for OpenBLAS 0.3.31, OpenCV 4.13.0, FFmpeg 8.0.1, Leptonica 1.87.0, Tesseract 5.5.2
45

src/main/java/org/bytedeco/javacv/FFmpegFrameFilter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ public synchronized void releaseUnsafe() throws Exception {
206206
filt_frame = null;
207207
}
208208
frame = null;
209+
Pointer.trimMemory();
209210
}
210211
@Override protected void finalize() throws Throwable {
211212
super.finalize();

src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ public synchronized void releaseUnsafe() throws Exception {
291291
}
292292
}
293293
}
294+
Pointer.trimMemory();
294295
}
295296
@Override protected void finalize() throws Throwable {
296297
super.finalize();

src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ public synchronized void releaseUnsafe() throws Exception {
328328
}
329329
}
330330
}
331+
Pointer.trimMemory();
331332
}
332333
@Override protected void finalize() throws Throwable {
333334
super.finalize();

0 commit comments

Comments
 (0)