Re: Memory usage and page numbering...

2013-08-10 Thread Mahesh Rayudu
Hi,

I noticed memory leak issue in font complex-scripts features with trunk
code. Not seen any memory issues with page numbers/totals. I tested my code
on Mac 10.7 and CentOS 6.4 with visualvm profiler.

Thank you,
Mahesh


On Fri, Aug 9, 2013 at 12:20 AM, Bernard Giannetti 
thebernmeis...@hotmail.com wrote:

 Hi,

 I have a Java desktop application, using embedded FOP to create PDFs from
 a data XML file and an XSLT file.  I wanted to see how much memory is being
 used, given the point about memory usage, page numbers and page totals (
 http://xmlgraphics.apache.org/fop/1.1/running.html#memory).

 My PDF reports have a page N of TOTAL at the bottom right of each page
 and I wanted to see the memory usage and compare to no page numbers and
 just page numbers without totals.  I also used the two variations for page
 number totals (XSL 1.0 and XSL 1.1).

 To work out the memory usage I computed the difference when
 calling Runtime.getRuntime().freeMemory() at the start and end of the
 render process.  I ran each render variation 5 times from a shell script
 and each render kicked off a separate JVM to avoid any caching.  Regardless
 of whether I had page numbers or not, and page totals or not, it seemed the
 result is that there is no difference between having page numbers/totals or
 not.  Sometimes the memory usage was 50 MB and sometimes 200 MB.

 I then used the sample code and data files from embedded FOP,
 http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_1/examples/embedding/.
  I modified the data XML file to contain lots of entries, giving a data
 file size of about 1 MB.  I also modified the XLST file to include pages
 numbers and then also page totals.  Again, I noticed no difference in
 memory usage.

 Given the varying values for memory usage I'm seeing, I assume my quick
 and dirty method is inadequate.  I expected variation, but mostly to see
 far less memory usage when no page totals were used, but that's not the
 case.

 Has anyone seen similar results?  Does using page totals really use THAT
 much more memory compared to not using page totals?


 Thanks in advance,

 Bernard.



Re: Memory usage and page numbering...

2013-08-10 Thread Glenn Adams
On Sat, Aug 10, 2013 at 5:55 PM, Mahesh Rayudu mahesh.ray...@gmail.comwrote:

 I noticed memory leak issue in font complex-scripts features with trunk
 code. Not seen any memory issues with page numbers/totals. I tested my code
 on Mac 10.7 and CentOS 6.4 with visualvm profiler.


Be specific.


RE: Memory usage and page numbering...

2013-08-09 Thread Bernard Giannetti
Thanks Robert - I found https://code.google.com/a/eclipselabs.org/p/jvmmonitor/ 
which I managed to get running in a few minutes and has pretty realtime graphs! 
 Good enough to get started :-)

From: rme...@hotmail.co.uk
To: fop-users@xmlgraphics.apache.org
Subject: RE: Memory usage and page numbering...
Date: Fri, 9 Aug 2013 09:02:44 +




Hi Bernard,

From my experience of trying to study the memory impact between builds, the 
getRuntime().freeMemory() method I found was very unreliable due to the nature 
of the JVM. I was getting back different results each time I ran it and even 
after purposefully modifying one build to run inefficiently, it returned the 
opposite to what I was expecting. As such, I ended up using a profiler which 
allowed me to break it down to see what was being run and identify memory hot 
spots and differences without being hampered by the somewhat random garbage 
collection.

Another method would be to generate and compare hprof dump output. There are a 
few tools out there to do this like the Eclipse Memory Analyzer [1]. To 
generate the dump, I just add the following to the FOP args:

-Xrunhprof:heap=sites,depth=depth required

Regards,

Robert Meyer

[1] http://www.eclipse.org/mat/

From: thebernmeis...@hotmail.com
To: fop-users@xmlgraphics.apache.org
Subject: Memory usage and page numbering...
Date: Fri, 9 Aug 2013 15:20:15 +1000




Hi,
I have a Java desktop application, using embedded FOP to create PDFs from a 
data XML file and an XSLT file.  I wanted to see how much memory is being used, 
given the point about memory usage, page numbers and page totals 
(http://xmlgraphics.apache.org/fop/1.1/running.html#memory).
My PDF reports have a page N of TOTAL at the bottom right of each page and I 
wanted to see the memory usage and compare to no page numbers and just page 
numbers without totals.  I also used the two variations for page number totals 
(XSL 1.0 and XSL 1.1).
To work out the memory usage I computed the difference when calling 
Runtime.getRuntime().freeMemory() at the start and end of the render process.  
I ran each render variation 5 times from a shell script and each render kicked 
off a separate JVM to avoid any caching.  Regardless of whether I had page 
numbers or not, and page totals or not, it seemed the result is that there is 
no difference between having page numbers/totals or not.  Sometimes the memory 
usage was 50 MB and sometimes 200 MB.
I then used the sample code and data files from embedded FOP, 
http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_1/examples/embedding/.  
I modified the data XML file to contain lots of entries, giving a data file 
size of about 1 MB.  I also modified the XLST file to include pages numbers and 
then also page totals.  Again, I noticed no difference in memory usage.
Given the varying values for memory usage I'm seeing, I assume my quick and 
dirty method is inadequate.  I expected variation, but mostly to see far less 
memory usage when no page totals were used, but that's not the case.
Has anyone seen similar results?  Does using page totals really use THAT much 
more memory compared to not using page totals?
Thanks in advance,Bernard.  
  

RE: Memory usage and page numbering...

2013-08-09 Thread Bernard Giannetti
Having now done a few runs using JVM Monitor on both Ubuntu 32 bit and 64 bit, 
I've found that the heap memory is slightly less when page numbers with totals 
are used compared to no page numbers at all.  Slightly less, but really nothing 
worth howling about.
From the FOP section on Memory Usage, specifically Forward References, it 
just doesn't seem to add up that page totals uses far more memory than not 
using page totals.  Is the note about extra memory usage perhaps a hangover 
from an older version of FOP?
Has anyone else found memory to be no different whether page numbers/totals are 
used or not?

From: thebernmeis...@hotmail.com
To: fop-users@xmlgraphics.apache.org
Subject: RE: Memory usage and page numbering...
Date: Fri, 9 Aug 2013 21:40:06 +1000




Thanks Robert - I found https://code.google.com/a/eclipselabs.org/p/jvmmonitor/ 
which I managed to get running in a few minutes and has pretty realtime graphs! 
 Good enough to get started :-)

From: rme...@hotmail.co.uk
To: fop-users@xmlgraphics.apache.org
Subject: RE: Memory usage and page numbering...
Date: Fri, 9 Aug 2013 09:02:44 +




Hi Bernard,

From my experience of trying to study the memory impact between builds, the 
getRuntime().freeMemory() method I found was very unreliable due to the nature 
of the JVM. I was getting back different results each time I ran it and even 
after purposefully modifying one build to run inefficiently, it returned the 
opposite to what I was expecting. As such, I ended up using a profiler which 
allowed me to break it down to see what was being run and identify memory hot 
spots and differences without being hampered by the somewhat random garbage 
collection.

Another method would be to generate and compare hprof dump output. There are a 
few tools out there to do this like the Eclipse Memory Analyzer [1]. To 
generate the dump, I just add the following to the FOP args:

-Xrunhprof:heap=sites,depth=depth required

Regards,

Robert Meyer

[1] http://www.eclipse.org/mat/

From: thebernmeis...@hotmail.com
To: fop-users@xmlgraphics.apache.org
Subject: Memory usage and page numbering...
Date: Fri, 9 Aug 2013 15:20:15 +1000




Hi,
I have a Java desktop application, using embedded FOP to create PDFs from a 
data XML file and an XSLT file.  I wanted to see how much memory is being used, 
given the point about memory usage, page numbers and page totals 
(http://xmlgraphics.apache.org/fop/1.1/running.html#memory).
My PDF reports have a page N of TOTAL at the bottom right of each page and I 
wanted to see the memory usage and compare to no page numbers and just page 
numbers without totals.  I also used the two variations for page number totals 
(XSL 1.0 and XSL 1.1).
To work out the memory usage I computed the difference when calling 
Runtime.getRuntime().freeMemory() at the start and end of the render process.  
I ran each render variation 5 times from a shell script and each render kicked 
off a separate JVM to avoid any caching.  Regardless of whether I had page 
numbers or not, and page totals or not, it seemed the result is that there is 
no difference between having page numbers/totals or not.  Sometimes the memory 
usage was 50 MB and sometimes 200 MB.
I then used the sample code and data files from embedded FOP, 
http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_1/examples/embedding/.  
I modified the data XML file to contain lots of entries, giving a data file 
size of about 1 MB.  I also modified the XLST file to include pages numbers and 
then also page totals.  Again, I noticed no difference in memory usage.
Given the varying values for memory usage I'm seeing, I assume my quick and 
dirty method is inadequate.  I expected variation, but mostly to see far less 
memory usage when no page totals were used, but that's not the case.
Has anyone seen similar results?  Does using page totals really use THAT much 
more memory compared to not using page totals?
Thanks in advance,Bernard.  

  

Memory usage and page numbering...

2013-08-08 Thread Bernard Giannetti
Hi,
I have a Java desktop application, using embedded FOP to create PDFs from a 
data XML file and an XSLT file.  I wanted to see how much memory is being used, 
given the point about memory usage, page numbers and page totals 
(http://xmlgraphics.apache.org/fop/1.1/running.html#memory).
My PDF reports have a page N of TOTAL at the bottom right of each page and I 
wanted to see the memory usage and compare to no page numbers and just page 
numbers without totals.  I also used the two variations for page number totals 
(XSL 1.0 and XSL 1.1).
To work out the memory usage I computed the difference when calling 
Runtime.getRuntime().freeMemory() at the start and end of the render process.  
I ran each render variation 5 times from a shell script and each render kicked 
off a separate JVM to avoid any caching.  Regardless of whether I had page 
numbers or not, and page totals or not, it seemed the result is that there is 
no difference between having page numbers/totals or not.  Sometimes the memory 
usage was 50 MB and sometimes 200 MB.
I then used the sample code and data files from embedded FOP, 
http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_1/examples/embedding/.  
I modified the data XML file to contain lots of entries, giving a data file 
size of about 1 MB.  I also modified the XLST file to include pages numbers and 
then also page totals.  Again, I noticed no difference in memory usage.
Given the varying values for memory usage I'm seeing, I assume my quick and 
dirty method is inadequate.  I expected variation, but mostly to see far less 
memory usage when no page totals were used, but that's not the case.
Has anyone seen similar results?  Does using page totals really use THAT much 
more memory compared to not using page totals?
Thanks in advance,Bernard.