Very much related to
XWIKI-16637, it's the same context, but the 2 can be fixed independently so I am reporting a new bug.
When performing an extension install replay on lots of wikis / with lots of logs, these UI that displays these logs is generated by the page ExtensionHistory, through velocity and wiki syntax.
The content can become extremely long (because lots of logs) and, just like for
XWIKI-16637, javacc goes nuts and needs a lot of memory to parse this enormous html macro content (probably because of the lookhead).
The potential fix for this is to fetch logs for the replay job other than going through wiki syntax.