You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Willard Rusch <ru...@willardrusch.com> on 2002/10/03 08:03:30 UTC

XPathContext.m_last_pushed_rtfdtm has become quite large

I'm seeing XPathContext.m_last_pushed_rtfdtm grow without bound
in an application that applies a single transformer instance to a series
of many (>100000) small documents.

The app eventually melts down because of a very large int[] array
in the address space (in m_last_pushed_rtfdtm).

Would someone familiar with XPathContext be able to explain why
popRTFContext does not always release memory reserved by
pushRTFConext (see below...)

Many thanks in advance.  Regards,

--Will Rusch



pushRTFContext() always pushes m_last_pushed_rtfdtm:

     public void pushRTFContext()
     {
         m_last_pushed_rtfdtm.push(m_which_rtfdtm);
         if(null!=m_rtfdtm_stack)
             ((SAX2RTFDTM)(getRTFDTM())).pushRewindMark();
     }

But it looks like popRTFContext does not always give it back:

     public void popRTFContext()
     {
         if(null==m_rtfdtm_stack)
                 return;
         int previous=m_last_pushed_rtfdtm.pop();
         ...
     }

Should those two statements be transposed?  It seems to make
my app happy, but is it safe?

         int previous=m_last_pushed_rtfdtm.pop();
         if(null==m_rtfdtm_stack)
                 return;

 From grepping the source it seems like these methods are always
called in pairs from ElemTemplate.execute()

	pushRTFContext();
	...
	popRTFContext();