I am getting a crashing Prince process on a large job. I am using the php wrapper and I get a blank response instead of the expected 'success'. I have spent most of the day trying to figure out what is going on, but haven't had any luck so far. I did notice that the last line of output from Prince is `filter resolution reduced by factor 0.88` which I have never seen before. Can that be part of the problem? I am having a horrible debugging this because it is for a production job that when I tried pulling locally ran fine. The only place it appears to be screwing up is an EC2 instance but I can't get enough information out of Prince to figure out *why*. Do you have any pointers to get more info out of Prince on this?
Crashing Prince process
Perhaps it is forcing the rasterisation of a very large image, are you using SVG or the CSS filter property? Does the EC2 instance have less RAM available than your local machine?
This is a large job with a ton of very large images, and I am using both SVG and CSS filters. The EC2 instance has 4GB of memory but I never saw it go above ~88% of the RAM. Do you think it is due to a memory limitation? I can probably see if I can reproduce that locally by lowering the amount of RAM available to my VM.
Edited by daneren2005
I just tried it with a 2GB limit and it went right up to the 2GB limit multiple times but never crashed like it did on production
Are you running a 32-bit or 64-bit Prince package?
I am running the 64-bit package
Sounds like the problem is related to memory exhaustion caused by having many large images with filters; if the images are unfiltered then they should be processed one at a time with much lower memory usage, which you can test by disabling filters. The warning about reduced filter resolution suggests that the size of the images may be over 3000x3000 pixels, do you know roughly how many are in the document?
(over 3000 pixels in one dimension, not necessarily both)
Looks like I was running into errors that were hard to debug due to Kubernetes disabling swap. Once I did that locally as well I was able to reproduce the crash and confirm it was due to memory starvation. Thank you for your help looking into this.
We will see if we can make further efforts to reduce memory usage in a future release.