Mendix uses Apache FOP to create pdf’s. When you merge/overlay pdf’s using CommunityCommons then PDFBox is used. Things you could do regarding memory:
- create pdf’s in batches and merge
- reduce PPI in the template properties
- add memory to your environment
Both cpu and memory take a hit when generating/merging pdf’s and it’s quite hard to reduce that. In the end upgrading the environment is the only option, but that also has it’s limits.