The issue can be reproduced when Upload script is packing to tar (without compression) Event, which contains a lot of frames.
In my case it was over 6000 jpeg files in full HD resolution. Unfortunately Tar->create_archive perl function in zmfilter.pl is used, which creates archive in RAM and at the end flush tar file do destination directory (in my case HDD). During packing I observed in htop memory consumption, and zmfilter.pl process used whole RAM till the system failure (out of 8GB memory).
I am not familiar with perl, but in my opinion different function should be used here. Please consider, that a lot of files can be tarred and uploaded.
How about using built in system tar command in zmfilter.pl script?
Upload script in zmfilter.pl cause out of RAM memory
Re: Upload script in zmfilter.pl cause out of RAM memory
Yes I think using the tar utility is probably the right thing to do.
Re: Upload script in zmfilter.pl cause out of RAM memory
As I wrote before, I am not familiar with perl. Could someone propose code instead of this below:
but with the same functionality.
Code: Select all
$archLocPath = $Config{ZM_UPLOAD_LOC_DIR}.'/'.$archFile;
Info( "Creating upload file '$archLocPath', ".int(@archImageFiles)." files\n" );
if ( $archError = !Archive::Tar->create_archive(
$archLocPath,
$Config{ZM_UPLOAD_ARCH_COMPRESS},
@archImageFiles
)
)
{
Error( "Tar error: ".Archive::Tar->error()."\n " );
}