Aspose is throwing a System.OutOfMemoryException fatal error (see below)
The code that I’m using is as follows (in psuedo code)
- Create a presentation from a template
- create a “merge” array (in this case I’m merging from 21 different presentation to create a new presentation of 84 slides)
- execute “mergeslides” to combine all my source decks and slide into my new output presentation
This code works fine for smaller presentations, but throws out of memory when I get to production sizes
— Best solution for me is if there is a way of increasing the amount of memory on the Aspose side so this works
— Alternative is there a way to break the merge into multiple operations that will avoid the out of memory
If helpful I can PM the decks and code
Also – I’m using AWS for storage.
Thanks
Here is a smaller example that works
Success: PutPresentationMerge. Parameters: name ‘output_2020-06-06_12-43-46_u5edbc7c2b2bbf.pptx’, request ‘{“Presentations”:[{“Path”:“santander\S97.pptx”,“Slides”:[21]},{“Path”:“santander\S94.pptx”,“Slides”:[1]},{“Path”:“santander\S97.pptx”,“Slides”:[6,7,10,11,12,13,8,9,14,15,23,22]},{“Path”:“santander\S82.pptx”,“Slides”:[4,5,6,7]},{“Path”:“santander\S97.pptx”,“Slides”:[24,25,26,27]},{“Path”:“santander\S95.pptx”,“Slides”:[34,29,30,31,32,33]},{“Path”:“santander\S77.pptx”,“Slides”:[12,4,5]},{“Path”:“santander\S95.pptx”,“Slides”:[36]},{“Path”:“santander\S84.pptx”,“Slides”:[1,2,3]},{“Path”:“santander\S72.pptx”,“Slides”:[2,3,4,5,6]},{“Path”:“santander\S64.pptx”,“Slides”:[1,2]},{“Path”:“santander\S63.pptx”,“Slides”:[1,2]},{“Path”:“santander\S83.pptx”,“Slides”:[2,3,4]},{“Path”:“santander\S86.pptx”,“Slides”:[2,5,3,6]}]}’, storage ‘emiaws’, folder ‘finalDecks’.
But when I get to a larger production-sized presentation it throws the error
Error thrown:
Fatal error: Uncaught Aspose\Slides\Cloud\Sdk\Api\ApiException: [400] Client error: `PUT https://api.aspose.cloud/v3.0/slides/output_2020-06-07_09-23-22_u5edcea4a8121e.pptx/merge?storage=emiaws&folder=finalDecks` resulted in a `400 Bad Request` response:
{"error":{"code":"error","message":"Exception of type 'System.OutOfMemoryException' was thrown.","description":"Operatio (truncated...)
in /var/www/emi/composer/vendor/aspose/slides-sdk-php/sdk/Api/ApiBase.php:84
Stack trace:
#0 /var/www/emi/composer/vendor/aspose/slides-sdk-php/sdk/Api/SlidesApi.php(16950): Aspose\Slides\Cloud\Sdk\Api\ApiBase->httpCall(Object(GuzzleHttp\Psr7\Request))
#1 /var/www/emi/composer/vendor/aspose/slides-sdk-php/sdk/Api/SlidesApi.php(16934): Aspose\Slides\Cloud\Sdk\Api\SlidesApi->putPresentationMergeWithHttpInfo(Object(Aspose\Slides\Cloud\Sdk\Model\Requests\PutPresentationMergeRequest))
#2 /var/www/emi/aspose/asposeFunctions.php(230): Aspose\Slides\Cloud\Sdk\Api\SlidesApi->putPresentationMerge(Object(Aspose\Slides\Cloud\Sdk\Model\Requests\PutPr in /var/www/emi/composer/vendor/aspose/slides-sdk-php/sdk/Api/ApiBase.php on line 84
I’m also getting
Fatal error: Uncaught Aspose\Slides\Cloud\Sdk\Api\ApiException: [502] Server error:
502 Bad GatewayPOST https://api.aspose.cloud/v3.0/slides/output_2020-06-07_12-32-05_u5edd16859410a.pptx/replaceText?oldValue=%25%25Meeting_description&newValue=introduction&folder=finalDecks&storage=emiaws
resulted in a502 Bad Gateway
response:502 Bad Gateway
(truncated...) in /var/www/emi/composer/vendor/aspose/slides-sdk-php/sdk/Api/ApiBase.php:84 Stack trace: #0 /var/www/emi/composer/vendor/aspose/slides-sdk-php/sdk/Api/SlidesApi.php(15444): Aspose\Slides\Cloud\Sdk\Api\ApiBase->httpCall(Object(GuzzleHttp\Psr7\Request)) #1 /var/www/emi/composer/vendor/aspose/slides-sdk-php/sdk/Api/SlidesApi.php(15428): Aspose\Slides\Cloud\Sdk\Api\SlidesApi->postSlidesPresentationReplaceTextWithHttpInfo(Object(Aspose\Slides\Cloud\Sdk\Model\Requests\PostSlidesPresentationReplaceTextRequest)) #2 /var/www/emi/aspose/asposeFunctions.php(44): Aspose\Slides\Cloud\Sd in /var/www/emi/composer/vendor/aspose/slides-sdk-php/sdk/Api/ApiBase.php on line 84
On a slightly smaller presentation where the merge works, but I’m getting the error trying to PresentationReplaceText.
Is the 502 Bad Gateway a generic error for “too big” and how can I increase the maximum size?