Hello,
Please run the included sample using PHP CLI mode and update the topic if it works.
Maybe you need to restart the web server to apply the mem changes?, if you still see the same exhaused memory size then the new setting is not being applied properly.
Regards.