exiftool stay_open 2 processes (parent process+child process)

Started by QGtKMlLz, August 30, 2023, 12:43:58 PM

Previous topic - Next topic

QGtKMlLz

I am trying to start/change the process priority of the exiftool.exe that runs the reading and writing of files.  I see that 2 processes are running when stay_open is used. One process uses ~700KB and the second one uses 40MB of memory. I have my powershell script start and change the process Priority with the below lines, but I see the 700KB is correctly set at RealTime, but the 40MB is set at "BelowNormal"?  The documentation makes no mention of process priority, and the only other reference I found on this was this 1 post by Phil refering to a "Parent Process" https://exiftool.org/forum/index.php?topic=12736.msg68853#msg68853 .

Does anyone have an idea how to change the Windows process priority so that both are RealTime?


$procStartInfo = [System.Diagnostics.ProcessStartInfo]::new()
$procStartInfo.FileName = "exiftool.exe"
$procStartInfo.Arguments = "-stay_open True  -@ -"
$procStartInfo.RedirectStandardInput = $true
$procStartInfo.RedirectStandardOutput = $true
$procStartInfo.UseShellExecute = $false

$ExifToolProcess = [System.Diagnostics.Process]::Start($procStartInfo)
$ExifToolProcess.PriorityClass = [System.Diagnostics.ProcessPriorityClass]::RealTime

obetz

did you try my "alternate ExifTool Windows installer"?

It uses Perl directly without PAR/pp

QGtKMlLz

Thanks.  I downloaded it, but I see little documentation, and the help command lists the exact same text as the normal exiftool? 

StarGeek

It is the exactly the same exiftool, except for the way it runs. The documentation hasn't changed.

The regular Windows "executable" is a Perl PAR Packed file. It is basically a zip file that contains a bare bones copy of Perl and the exiftool Perl source code.  When you run the program, these are extracted into your Temp directory and run from there.  This can cause problems with some systems, especially with some virus checkers. Oliver's version works differently and can avoid most problems like this.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

obetz

meanwhile I compared the "original" PAR packed ExifTool and my version with "-stay_open true  -@ -".

The PAR packed version runs two processes, both named "exiftool.exe (32 Bit)"

My ExifTool package starts only one process "ExifTool Perl launcher".

This is caused by PAR's hairy boot process, which I described in https://oliverbetz.de/pages/Artikel/Portable-Perl-Applications a few years ago but forgot the details. Sorry for not reporting earlier.

@QGtKMlLz, did my package solve your problem?

QGtKMlLz

Yes, I had added to my script too and it works as expected, 1 process, and powershell is able to assign it as a 'RealTime' process.

Thank You BOTH!

obetz

Thanks for the confirmation, I added your observation to the description of my "portable Perl launcher".