bytedeco/javacv
View on GitHublinux-arm64 grabber.close() the memory do not release
Open
#1,847 opened on Jul 25, 2022
enhancementhelp wanted
Repository metrics
- Stars
- (6,985 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
as the title describe ,i use Pointer.formatBytes(Pointer.physicalBytes()) to mark the memory usage , when i call the grabber.close() and record.close(), in my macos,it release the memory ,but in linux-arm64 ,it can't
system: Linux version 4.9.201-tegra (rich@Vostro-5490) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05) )
FFmpegFrameGrabber grabber = new FFmpegFrameGrabber("rtsp://admin:LH123456@172.16.3.229:554/h264/ch41/main/av_stream");
grabber.start();
FFmpegFrameRecorder recorder = new FFmpegFrameRecorder("/data/ffmpeg/id-%03d.png", 1080, 720, 0);
recorder.setFormat("image2");
recorder.setOption("update", "0");
recorder.start();
try {
Frame frame = null;
int i = 0;
for (; (frame = grabber.grabImage()) != null; ) {
try {
recorder.record(frame);
i++;
if (i > 6) {
break;
}
} catch (org.bytedeco.javacv.FrameRecorder.Exception e) {
e.printStackTrace();
}
}
} finally {
log.info("before:{}", Pointer.formatBytes(Pointer.physicalBytes()));
grabber.close();
recorder.close();
log.info("after:{}", Pointer.formatBytes(Pointer.physicalBytes()));
}