And alternative title of this post is “producing large documents with RPE – update for 1.2.1.” Earlier this year I have described the solutions you can use to for Producing Large Documents with RPE I will revisit this now as we have simplified how the “multipart Word output” works.
Enabling Multipart output
To enable the multi part Word output in ROPE 126.96.36.199 and older one had to define the “com.ibm.rational.rpe.word.multipart” flag for the JRE used to run RPE. Typically that meant adding the -Dcom.ibm.rational.rpe.word.multipart=dynamic/static in launcher/studio ini files.
The main disadvantage of this approach is its reduced usability. Being a global setting means that all documents generated by a Launcher/Studio/Java customization with this flag defined would split the Word output in parts. With RPE 1.2.1 we have added “multipart” as an option of the Word output so the end user can make this decission on the fly for each Word document produced.
NOTE: the “com.ibm.rational.rpe.word.multipart” is still supported in RPE 1.2.1 and will continue to be supported for a number of releases but we will eventually deprecate so we recommend adopting the new way of selecting multipart output.
Dynamic vs Static Multipart
There are 2 possible values for the Word multipart option in RPE: static and dynamic. The two produce the exact same results but they do it in a different way and with different memory usage:
- dynamic – each part (section) is written to the filesystem and removed from memory as soon as it’s finished. This means that the document’s footprint in memory is limited to that of a single section at all times.
- static – the document is split after all the data has been processed and the full Word document is built in memory. The memory gain still exists as the process of serializing a full document further increases the memory consumed by the model, but this gain is far smaller than the one provided by the dynamic serialization.
From the above description it the Dynamic is the clearly superior option in terms of memory consumption. So when and why would you want to use static? The answer is documents with regions. If your template makes heavy use of regions then discarding a section from memory cannot be done until the document is completed so in that scenario static must be used.