Heap size recommendation for Docker

Hi,

We have a micro service that use Aspose.Slides v17.10 on JDK 1.8 for extracting presentations into slides. The slides are stored in different formats like SVG, PPT and PNG. We package the service within docker containers and deploy on AWS using EC-2 Container service or Elastic Container service (ECS). At present we have defined at least 3.5G as max heap size. This works for many presentations. But on some cases Aspose request for memory allocation results in the heap size to grow beyond 4G. This causes sluggishness in service performance and the ECS service restarts the container as it has exceeded soft memory limits.

What would be an ideal max heap size to be defined for this service. Is it is a good idea. to run such a service within a docker container where we have to be sure of the max heap size.

@rahul.contiq,

I have observed the requirements shared by you and like to mention that heap size depends on presentation deck you are using. If you are using a huge presentation with enormous number of slides and with many shapes (specially multimedia) content, then amount of required heap size will also increase. When you use Aspose.Slides to load presentation in memory, its Document Object Model (DOM) gets loaded along with all statics. I hope this will be helpful. Secondly, I also suggest you to please use a same Presentation object on your end to load second or third presentations as it will somehow give impact of improved performance as any new Presentation loads the statics in memory and consumes time.

Thanks.

Do you have any pre-defined recommendation for decks of varying sizes. Otherwise it would mean re-visiting the heap size all the time for different kind of presentation. Is there an ideal max heap size we can set which would hold good for the average kind of presentations.

@rahul.contiq,

There is no hard and fast binding available in this regard. As shared earlier, it all depends on presentation deck size and content inside that. You can use some optimal heap size based on general analysis of presentation sizes used on your end.