Is there a limitation on the number of values the replace and render macro can hold?

Gajan UMAPATHY October 28, 2012

We are getting an error "Error formatting macro: run: java.lang.StackOverflowError" when using the replace and render macro. It works on preview until we select the top 785 but fails with the above error when we save the page. It work both on preview and page save when we only select top 100 or nay lower numbers.

{replace-and-render}
{replace-item:%componentsel%}{sql:dataSource=DS|output=html|heading=false|border=0|table=false}
 select top 1000':''',ccc,''':''',ccc,'''' from (
   select distinct component as ccc from releases where 
   date>dateadd([year],-1,GETDATE())
union 
   select distinct component as ccc from installs where  expdate >= getdate() 
)  as c  order by ccc asc
{sql}{replace-item}
{replace-body}
{run:autorun=true|replace=component:sysadmin:Select component:select:%componentsel%}


{run}
{replace-body}
{replace-and-render}

1 answer

1 accepted

0 votes
Answer accepted
Gajan UMAPATHY November 14, 2012

I've got the answer from the developer Bob as follows:

1. Stack overflow errors can occur when using regex patterns that are large or complex. Sometimes this is due to error but in some cases it just requires more stack space.

2. Try increasing your stack space and see if that allows a higher #. If so, keep increasing until it covers your case. For instance, I have used -Xss4096k on a Confluence instance with more complex cases.

So I've increased our stack space on is-testconfluence to -Xss40966k and your script now works fine

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events