Thanks for your reply, I tried the same conversion using PHP CLI and I have the same issue, sadly.
But when I use Release() after the Quit(), it gives me this error : COMException (0x800706BA): The RPC server is unavailable. Seems understandable since I asked to quit, but if I release before the quit(), I have this : COMException (0x80020003): Member not found.
If I comment the free memory section, I still have a 30s waiting time, cause I suppose PHP is killing the pointer anyway at the end.