multi-pass-opt-analysis and multi-pass-opt-distortion causes memory leak in encoder

Issue #315 resolved
H0W1K2 created an issue

Hello, I tried multi-pass-opt-analysis and multi-pass-opt-distortion options in encoder and both causes memory leaks, here is command line I used and options I used and only additional command I add is two options one by one <--multi-pass-opt-analysis or --multi-pass-opt-distortion>

"D:\BD-Rebuilder\BD-RBV05020\tools\avs2yuv.exe" "D:\BD-REBUILDER\WORKFILES\VID_00003.AVS" -o - | "D:\BD-Rebuilder\BD-RBV05020\tools\x265-64.exe" - --preset slower --qpfile "D:\BD-REBUILDER\WORKFILES\VID_00003.CHP" --keyint 240 --bitrate 3300 --y4m --stats "D:\BD-REBUILDER\WORKFILES\x265_analysis.stats" --pass 1 --output "D:\BD-REBUILDER\WORKFILES\VID_00003.AVS.hevc" --frames 227562

Here are screenshot of memory consumption after one, five, ten and twenty minutes for multi-pass-opt-analysis

http://imgh.us/000.X265_(One_Minute_After_Launch).png

http://imgh.us/000.X265_(Five_Minute_After_Launch).png

http://imgh.us/000.X265_(Ten_Minute_After_Launch).png

http://imgh.us/000.X265_(Twenty_Minute_After_Launch).png

Here are screenshot of memory consumption after one, five, ten and twenty minutes for multi-pass-opt-distortion

http://imgh.us/010.X265_(One_Minute_After_Launch).png

http://imgh.us/010.X265_(Five_Minute_After_Launch).png

http://imgh.us/010.X265_(Ten_Minute_After_Launch).png

http://imgh.us/010.X265_(Twenty_Minute_After_Launch).png

As you can see memory increase gradually with passage of time and it keep increasing till host OS memory run out.

Comments (9)

  1. Pradeep Ramachandran Account Deactivated

    Thanks for the report. These options are expected to increase the memory consumption as we're storing analysis information regarding the best partitions for each frame. We then will dump this information into a file and read it in pass-2 to improve its speed.

    We shall investigate if we can limit the memory consumption from these options somehow.

  2. H0W1K2 reporter

    Thank you for follow up, since you mentioned increasing of memory consumption with these options. I decided to do another instance, but this time I let it run for quite some time in hopes of finding if there is max limit where memory consumption stabilize. However from what I am observing so far it seems there is no limit to it.

    X265 has been running for four hours and here is memory consumption, after running for four hours and it keeps climbing steadily with passage of time.

    http://imgh.us/030.X265_(Four_Hours_After_Launch).png

    Here is screenshot of encoder and stage it was at, when I took screenshot of memory usage.

    http://imgh.us/Setting_02.png

  3. Pradeep Ramachandran Account Deactivated

    We just pushed in a patch to prevent the leak - that should hopefully sort your issue out. Can you please update your build and try again?

  4. Log in to comment