[ 
https://issues.apache.org/jira/browse/XALANJ-2627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17722422#comment-17722422
 ] 

Joe Kesselman commented on XALANJ-2627:
---------------------------------------

It's been a long time since I looked at the code, but I would guess that this 
is because running them in cascade is pipelining them, meaning intermediate 
document models must be built and retained until transformation ends. Running 
them sequentially would use only with one input document model at a time, 
discarding it before moving to the next transformation.

That can be confirmed/refuted by pulling a heap dump and looking at what 
objects are consuming the additional storage (as well as by grovelling through 
the code in a debugger).

There may be space versus speed trade-offs here.

> Adding multiple transform using addTransform consumes huge memory and cause 
> OOM
> -------------------------------------------------------------------------------
>
>                 Key: XALANJ-2627
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2627
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in 
> Xalan projects.  Anybody can view the issue.) 
>            Reporter: Subhajit
>            Assignee: Gary D. Gregory
>            Priority: Major
>
> We are using XALAN for XSLT transformation. We have around 10 transformer. 
> Our pattern is
>  
> Transformation.builder(transformationFactory)
> .setUseInterpreter(true)
> .setLogger(log)
> .setSource(some source))
> .setResult(some target)
> .addTransform(Handler1())
> .addTransform(Handler2())
> .addTransform(Handler3())
> .addTransform(Handler4())
> .addTransform(Handler5())
> .addTransform(Handler6())
> .addTransform(Handler7())
> .addTransform(Handler8())
> .addTransform(Handler9())
> .addTransform(Handler10())
> .addTransform(Handler11())
> .addTransform(Handler12())
> .build()
> .transform();
>  
> This pattern seems to take lots of memory. But if  we do them individually 12 
> times (by using output of 1 as input of another), memory usage get reduced.
>  
> Transformation.builder(transformationFactory)
> .setUseInterpreter(true)
> .setLogger(log)
> .setSource(some source))
> .setResult(some target)
> .addTransform(Handler1())
> .build()
> .transform();
>  
> It seems Xalan is holding unnecessary memory for the 1st type of pattern
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org
For additional commands, e-mail: dev-h...@xalan.apache.org

Reply via email to