You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jason Timmins <ja...@interlinx.co.uk> on 2008/03/27 12:02:19 UTC

FOP 0.20 Memory Leak?

Hi There,

I know all the talk is of FOP 0.9X and it's all pretty cool but my project
is using good old 0.20.5.

For performance reasons, I've used IKVM to turn the FOP 0.20.5 binaries into
.NET executables. I run it with a .NET version of Saxon to produce PDFs in
large quantities. However, something is leaking memory at the rate of 1Mb
per PDF and it's killing the web server.

I'm trying to understand whether it's FOP or Saxon or IKVM that's leaking so
massively. One thing is certain, if I drop all the FOP/Saxon/IKVM the .NET
code runs well and doesn't leak.

I wondered if you guys had any thoughts on this? Simply, does FOP 0.20.5
leak memory when run continuously in the same execution environment?

Cheers
Jason.

Jason Timmins (Technical Director) InterLinx Ltd.
 Geo: West Mids, UK. Tele: +44 8707 430999. Fax: +44 8707 460999.
           Beyond here there be dragons.


________________________________________________________________________
This email has been scanned for all viruses by the InterLinx Anti-Virus
Email service. For more information on a proactive anti-virus service
working around the clock, around the globe, visit
http://www.interlinx.co.uk/anti-virus-anti-spam.htm
________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: FOP 0.20 Memory Leak?

Posted by Jason Timmins <ja...@interlinx.co.uk>.
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> Sent: 27 March 2008 12:35
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: FOP 0.20 Memory Leak?

Hi Jeremias,

> Not at all. You'd bring up a web container (such as Jetty or 
> Tomcat) up
> as a server process. The web container is multi-threaded and the web
> service would be deployed in that web container. After the first or
> second call to the webservice all Java byte code has run 
> through the JIT
> compiler and all classes will have been loaded. By then 
> you'll have very
> high response times. Even the threads will be pooled.

Sounds great it's just that it's a bit beyond my particular skill-set at the
moment. It seems like something other people might have wanted too, I wonder
if anyone out there has implemented such a thing already.

Thanks again.
Jason.

Jason Timmins (Technical Director) InterLinx Ltd.
 Geo: West Mids, UK. Tele: +44 8707 430999. Fax: +44 8707 460999.
           Beyond here there be dragons. 


________________________________________________________________________
This email has been scanned for all viruses by the InterLinx Anti-Virus
Email service. For more information on a proactive anti-virus service
working around the clock, around the globe, visit
http://www.interlinx.co.uk/anti-virus-anti-spam.htm
________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.20 Memory Leak?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 27.03.2008 13:25:16 Jason Timmins wrote:
<snip/>
> > I'd pack Saxon and FOP together into a web service. That way you don't
> > have the VM startup each time.
> 
> That'd be a web service written in Java I guess. Sadly, that's not an
> environment I'm comfortable with.

Ok, that can make things a little more complicated.

> Also, don't the processes associated with answering web services calls (as
> it were) come and go each time? A call comes in, Java fires-up, sends a
> responds and then Java goes away. Sounds like I'd hit the same kind of
> start-up delays I was getting initially. Admittedly, my app would be firing
> requests at the web service in quick succession so Java might not come and
> go each time. (This is really at the limit of my knowledge on such things!)

Not at all. You'd bring up a web container (such as Jetty or Tomcat) up
as a server process. The web container is multi-threaded and the web
service would be deployed in that web container. After the first or
second call to the webservice all Java byte code has run through the JIT
compiler and all classes will have been loaded. By then you'll have very
high response times. Even the threads will be pooled.

<snip/>


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.20 Memory Leak?

Posted by Andreas Delmelle <an...@telenet.be>.
On Mar 27, 2008, at 21:02, Andreas Delmelle wrote:
> On Mar 27, 2008, at 13:25, Jason Timmins wrote:
>   [Jeremias: ]
>>> <snip />
>>> IIS. *g* I've had my share of experiences with that thing.
>>
>> 'That thing!?!', Microsoft would have you believe that IIS runs  
>> half of the
>> web. :-)

<snip />

Forgot to add what I actually intended to point out... *sigh*

In the past months, I have read a few reports of users asking about  
possible memory-leaks (0.20 as well as 0.9X), and what struck me  
recently, is that in none of the cases the reporters were using the  
Sun JVM. I still have to receive confirmation, but I strongly suspect  
the problem to lie there. Abel's remark on IKVM's garbage-collection  
again seems to point in the direction of the environment, rather than  
FOP itself. Maybe FOP's code is a bit exotic in some sense, I don't  
know, but it seems like there are GC-implementations out there that  
can't handle it...

Unfortunately, I have received no further news from the involved  
parties after suggesting to run tests on other Java implementations,  
so as to rule out the possibility of the environment being a key  
factor. Since you mention using IIS, .NET etc. I assume your server  
is running on the World's Worst OS (?) [Sorry, couldn't resist... ;-) ]


Cheers

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.20 Memory Leak?

Posted by Andreas Delmelle <an...@telenet.be>.
On Mar 27, 2008, at 13:25, Jason Timmins wrote:
   [Jeremias: ]
>> <snip />
>> IIS. *g* I've had my share of experiences with that thing.
>
> 'That thing!?!', Microsoft would have you believe that IIS runs  
> half of the
> web. :-)

Heh, sure, and not only that. They would be right as well... Only,  
what does that statement prove exactly? 8->

Whether this suffices to NOT call it 'a thing', as Jeremias did, is a  
totally separate issue. "Quality != Quantity".
For those that remember the good old video-tapes: VHS also was far  
more widely used, but still in comparison to Betamax or V-2000 was a  
plain, outright crappy format. Still it obtained the largest market- 
share. Why? The reason has nothing to do with economy, more with  
psychology. The majority of people simply don't like to think (or  
even decide) for themselves. After all, it's much more comfortable to  
use what everyone else uses, to follow the herd... The tragic truth,  
some would call it. :-)
The really funny part is that the majority of that majority doesn't  
even realize that, and kid themselves into believing they actually do  
make conscious choices...

My point is definitely not that you are one of those herd-people that  
don't think. What I do mean is that the argument is rendered moot if  
you take the slightest bit of time to reflect on that statement... It  
does not say anything about IIS or Microsoft. It does say something  
about the people blindly using it, because either a) they don't know  
any better, or b) going a different route would actually require some  
effort on their part.


Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: FOP 0.20 Memory Leak?

Posted by Jason Timmins <ja...@interlinx.co.uk>.
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> Sent: 27 March 2008 11:53
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: FOP 0.20 Memory Leak?

Hi Jeremias,

> I'd pack Saxon and FOP together into a web service. That way you don't
> have the VM startup each time.

That'd be a web service written in Java I guess. Sadly, that's not an
environment I'm comfortable with.

Also, don't the processes associated with answering web services calls (as
it were) come and go each time? A call comes in, Java fires-up, sends a
responds and then Java goes away. Sounds like I'd hit the same kind of
start-up delays I was getting initially. Admittedly, my app would be firing
requests at the web service in quick succession so Java might not come and
go each time. (This is really at the limit of my knowledge on such things!)

> IIS. *g* I've had my share of experiences with that thing.

'That thing!?!', Microsoft would have you believe that IIS runs half of the
web. :-)

Cheers
Jason.

Jason Timmins (Technical Director) InterLinx Ltd.
 Geo: West Mids, UK. Tele: +44 8707 430999. Fax: +44 8707 460999.
           Beyond here there be dragons. 


________________________________________________________________________
This email has been scanned for all viruses by the InterLinx Anti-Virus
Email service. For more information on a proactive anti-virus service
working around the clock, around the globe, visit
http://www.interlinx.co.uk/anti-virus-anti-spam.htm
________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.20 Memory Leak?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 27.03.2008 12:25:32 Jason Timmins wrote:
> > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> > Sent: 27 March 2008 11:13
> > To: fop-users@xmlgraphics.apache.org
> > Subject: Re: FOP 0.20 Memory Leak?
> 
> Hi There,
> 
> > For performance reasons? In my tests, FOP is running slower 
> > in IKVM than
> > when it's run under a decent JVM. IKVM is fast but it brings some
> > overhead into the picture.
> 
> N-no, the problem is not with FOP, the problem is that I need to produce
> documents really quickly for high-volume PS printers. My .NET app produces
> the raw XML and uses Saxon to create the XLS and FOP to turn it into PS. The
> problem is that if I fire up the Java VM for Saxon and then again for FOP,
> document creation takes 7 seconds (way too slow.) If I turn those two
> packages into .NET assemblies and avoid the start-up delays of the Java VM,
> document creation times fall to 2 seconds as everything is in the same .NET
> execution environment.
> 
> If you can tell me how to keep Saxon and FOP running whilst I push large
> amounts of XML documents through them, I'd gladly give it a try.

I'd pack Saxon and FOP together into a web service. That way you don't
have the VM startup each time.

> > I don't know of any memory leaks in 0.20.5. A lot of people 
> > use (or used)
> > that version in production with no problems.
> 
> Which is why I'm asking. It might be Saxon or something in IKVM that leaks.
> 
> > Does .NET not have good tools to track down memory leaks?
> 
> Not that I'm aware of. The problem is complicated by it running as a web app
> in IIS. It's the IIS worker process that grows until it get's too big and is
> recycled.

IIS. *g* I've had my share of experiences with that thing.

> Bye for now
> Jason.
> 
> Jason Timmins (Technical Director) InterLinx Ltd.
>  Geo: West Mids, UK. Tele: +44 8707 430999. Fax: +44 8707 460999.
>            Beyond here there be dragons. 
> 



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.20 Memory Leak?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 27.03.2008 22:43:29 Andreas Delmelle wrote:
<snip/>
> If you're happy with .NET, all the better. The hints provided by  
> Jeremias and Abel earlier should prove that a 'redesign' of your app  
> would only require a minimal amount of effort, with possibly  
> significant performance benefits.
<snip/>

Frankly, I'm not so sure if there would be "significant" performance
benefits. I'm sure it would be faster but not necessarily by very much.
My suggestion to run Saxon and FOP in a Java context was rather
motivated by the fact that I don't expect memory leaks when running the
two in a JVM. However, it can still be that the memory loss occurs in a
different place. Jason's best bet, IMO, is to analyze what component
actually loses memory in his current setup.

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.20 Memory Leak?

Posted by Andreas Delmelle <an...@telenet.be>.
On Mar 27, 2008, at 17:41, Jason Timmins wrote:
>> <snip />
> Sure, in an ideal world, I'd throw-out 18 months of .NET and re- 
> write the
> whole thing in Java! I'm not going to get into a .NET vs Java  
> discussion.
> For me, for now, .NET is what I've got and what I'm happy with....  
> I could
> just do with not loosing 1Mb of RAM every time I make a PDF.
>
> ....I know, I'll just add more RAM!! ;-)

Reading this reminds me that one of the customers I worked for once  
actually received that exact response from a software vendor.
The user/developer was so good as to investigate memory issues up to  
a point where he was certain that the app was retaining heaps of  
memory with redundant or obsolete info. So he contacted support, and  
pointed out that the tool had serious problems with releasing caches,  
and they bluntly told him that he had no choice but to either reboot  
his system or buy more RAM... :-)

If you're happy with .NET, all the better. The hints provided by  
Jeremias and Abel earlier should prove that a 'redesign' of your app  
would only require a minimal amount of effort, with possibly  
significant performance benefits. It does not seem to me that you  
would literally need to 'rewrite the whole thing'.
Java is most likely already available on your system in one way or  
another. If not, installing it is a matter of minutes. You're stuck  
with the configuration and maintenance of the servlet container that  
was spoke of, of course, but that is about the only downside I can  
think of. It is a proverbial piece of cake, these days. In bigger  
companies, it's even likely that one exists already, and you just  
need to develop the servlet.

It basically comes down to:
- moving the related code you have in your .NET context to Java  
servlet-classes, adapt the syntax (minimal effort, if you know one  
programming-language, you know enough to learn them all, examples  
available in FOP's source distribution (*))
- configuring the servlet context, i.e. set up mappings for the URLs  
to use to call your Java code (requires some browsing through the  
related specs if you need advanced stuff, but for a very basic  
example, look at the web.xml example that is shipped with FOP (**)
- where you currently call out to FOP (and also Saxon, while you're  
at it), send an HTTP-request to one of those URLs instead, and  
process the response

Really not that hard, and I think most definitely worth a shot. Since  
you're in a web server context already, the transition should prove  
to be quite smooth.

(*) http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/ 
apache/fop/servlet/
(**) http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/conf/ 
web.xml?revision=627324&view=markup

Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: FOP 0.20 Memory Leak?

Posted by Jason Timmins <ja...@interlinx.co.uk>.
> From: Abel Braaksma [mailto:abel.online@xs4all.nl] 
> Sent: 27 March 2008 15:51
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: FOP 0.20 Memory Leak?

Hi Abel,

Thanks for taking the time to reply.

> There're samples of how to set up a simple web service that 
> can do the 
> trick. There are several ways to set this up, the easiest already 
> mentioned by Jeremias Maerki.

I did some searching too. Creating a web service in Java with Tomcat doesn't
look too tricky and the examples on the FOP site itself show how to put FOP
into Java apps so maybe it's possible..... y'know, for me.

> > the word is 'no XSLT v2 for now.'
> 
> There are two alternatives to Saxon (though I do believe that 

I'm happy enough with Saxon and as you say, it's supplied as a .NET
assembly. The problem is that the Saxon people use an old version of IKVM
which means my FOP translation also has to use that old version. I therefore
can't upgrade to a later version of IKVM until the Saxon people do. :-(

> Your story about MS not doing XSLT 2.0 is not right. They have spread 
> the word about half a year back that they started development for an 
> XSLT 2.0 processor. It is only a matter of time.

In fairness, I did say 'no XSLT v2 for now' and I'd like native .NET XSLT v2
right now (in-fact, I wanted it mid last year but Microsoft were giving no
signs of v2 support back then at all.)

> > No doubt but I have to stay with .NET as the rest of the 
> > site is .NET-based.
> 
> Without wanting to sound harsh: that's really not a good 
> reason to stick 
> to a certain technique, you're locking yourself in, keeping 
> the better 
> options out. Using a technique that best suits its purpose or that's 
> best at a certain job is a much more viable option then 
> trying to bend the iron by hands...

Sure, in an ideal world, I'd throw-out 18 months of .NET and re-write the
whole thing in Java! I'm not going to get into a .NET vs Java discussion.
For me, for now, .NET is what I've got and what I'm happy with.... I could
just do with not loosing 1Mb of RAM every time I make a PDF.

....I know, I'll just add more RAM!! ;-)

> If you change your mind on that last subject: I just spoke to 
> XSLFast's 
> Jens Thiemann, you may have heard of him,

No, I've not heard of him. We just bought the software. If you don't buy the
support you don't get your Emails answered by XSLFast. (And yes, I
understand you only get what you pay for.)

> and he assured me that it is 
> only days before they will start shipping a new version with full 
> support for FOP 0.93 and up.

That's very good news.

> And if you contact him directly using 
> info@xslfast.com, he can give you an early copy of the product.

Yeah, right. No money = No support. ;-)

> Hope these hints help you a bit further,

Yes. Very useful. Cheers Abel.

Bye for now
Jason.

Jason Timmins (Technical Director) InterLinx Ltd.
 Geo: West Mids, UK. Tele: +44 8707 430999. Fax: +44 8707 460999.
           Beyond here there be dragons. 


________________________________________________________________________
This email has been scanned for all viruses by the InterLinx Anti-Virus
Email service. For more information on a proactive anti-virus service
working around the clock, around the globe, visit
http://www.interlinx.co.uk/anti-virus-anti-spam.htm
________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.20 Memory Leak?

Posted by Abel Braaksma <ab...@xs4all.nl>.
Jason Timmins wrote:
>
> I don't know how to do that but, if you're telling me I can call Java
> methods straight from .NET without the delays associated with starting-up
> the Java VM, then I'd gladly try that.
>   

There're samples of how to set up a simple web service that can do the 
trick. There are several ways to set this up, the easiest already 
mentioned by Jeremias Maerki.

> The only reason I have to use Saxon is that Microsoft don't have an XSLT v2
> implementation. They seem focused on their LINQ technology at the moment so
> the word is 'no XSLT v2 for now.'
>   

There are two alternatives to Saxon (though I do believe that Saxon is 
the most mature currently): AltovaXML free commandline xslt2 processor 
and Colin's Gestalt XSLT 2.0 processor, open source, built with Eiffel. 
In my experience, the latter has the shortest startup time when run as 
an executable. But embedding an executable inside a web app can be hard 
and non-trivial to do correctly.

That said, Saxon is the only one that comes "natively" as a .NET processor.

Your story about MS not doing XSLT 2.0 is not right. They have spread 
the word about half a year back that they started development for an 
XSLT 2.0 processor. It is only a matter of time. In Michael Kay's words, 
it takes about 1 to 2 years to built a stable processor, depending on 
the team and the money available of course (meaning: it won't be there 
tomorrow).

>> It's plain and simple, even when you have limited 
>> knowledge of 
>> Java. And you don't need to exit the JVM anymore. This has two main 
>> benefits: you gain speed (perhaps a lot!) and your 
>> application becomes easier.
>>     
>
> No doubt but I have to stay with .NET as the rest of the site is .NET-based.
>   

Without wanting to sound harsh: that's really not a good reason to stick 
to a certain technique, you're locking yourself in, keeping the better 
options out. Using a technique that best suits its purpose or that's 
best at a certain job is a much more viable option then trying to bend 
the iron by hands...

>   
>> And while your at it, you might as well upgrade to a newer version of 
>> FOP, since yours is really ancient.
>>     
>
> Ahh, well, I've been holding-off upgrading because my XSL design tool,
> XSLFastm uses FOP 0.20.5 to render to PDF as a preview. I thought it only
> logical to stick with 0.20.5 until XSLFast switches to using the latest
> version of FOP. I can't have my development tool showing one thing and what
> gets printed being something different. That's one headache I can live
> without.
>
> Also, in my current environment I'd have to translate FOP 0.9X into a .NET
> assembly and I'm not looking forward to that.
>
>   

If you change your mind on that last subject: I just spoke to XSLFast's 
Jens Thiemann, you may have heard of him, and he assured me that it is 
only days before they will start shipping a new version with full 
support for FOP 0.93 and up. And if you contact him directly using 
info@xslfast.com, he can give you an early copy of the product.

>
> Oh man, if only it were that simple. I've never written code the cleans
> itself up so well as this app! I 'dispose' of every object and data
> structure I use. I can say with reasonable certainty, it's not crappy code
> in my .NET world. :-)
>   

Well, that's good to hear. Of course, any .NET application uses external 
libraries, so if it isn't your code for sure, it can be something else. 
In the past I've successfully used DevPartner by Compuware (then 
Numega). I don't want to sing the praises of DevPartner here as then I 
should make a sound comparison to other products as well. However, I 
mention it because it gives very good per-object, per reference analysis 
of what's been kept in memory (and a lot more, like how long each method 
takes, how often it's called etc) and how much memory each object takes.

But it doesn't come free, worse yet, I don't believe it is very cheap... 
yet it can save you tons of hours of work which makes such a product 
worthwhile (or any of its competitors of course).

Hope these hints help you a bit further,

Cheers,
-- Abel Braaksma

PS: you can check the Saxon list for some mentioning of memory leaks. 
There aren't many and most are fixed, but it may give you a hint. Make 
sure to use the utter latest edition of Saxon as it is constantly 
improved for performance and bugs.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: FOP 0.20 Memory Leak?

Posted by Jason Timmins <ja...@interlinx.co.uk>.
> From: Abel Braaksma [mailto:abel.online@xs4all.nl] 
> Sent: 27 March 2008 11:49
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: FOP 0.20 Memory Leak?

Hi Abel,

Thanks for the information.

> Jason Timmins wrote:
> > amounts of XML documents through them, I'd gladly give it a try.
> 
> You are making things way too complicated for yourself. FOP is a Java 
> app, Saxon is a Java app (it is available as .NET but that's an 
> automated port, not a .NET optimized version). Having two 
> Java apps and 
> calling them from IKVM makes things both slow and complicated at the 
> same time. Unless there's a compelling need for you to use 
> .NET for your 
> transformations (you mention using IIS) why not call both 
> Saxon and FOP 
> by code?

I don't know how to do that but, if you're telling me I can call Java
methods straight from .NET without the delays associated with starting-up
the Java VM, then I'd gladly try that.

The only reason I have to use Saxon is that Microsoft don't have an XSLT v2
implementation. They seem focused on their LINQ technology at the moment so
the word is 'no XSLT v2 for now.'

> It's plain and simple, even when you have limited 
> knowledge of 
> Java. And you don't need to exit the JVM anymore. This has two main 
> benefits: you gain speed (perhaps a lot!) and your 
> application becomes easier.

No doubt but I have to stay with .NET as the rest of the site is .NET-based.

> And while your at it, you might as well upgrade to a newer version of 
> FOP, since yours is really ancient.

Ahh, well, I've been holding-off upgrading because my XSL design tool,
XSLFastm uses FOP 0.20.5 to render to PDF as a preview. I thought it only
logical to stick with 0.20.5 until XSLFast switches to using the latest
version of FOP. I can't have my development tool showing one thing and what
gets printed being something different. That's one headache I can live
without.

Also, in my current environment I'd have to translate FOP 0.9X into a .NET
assembly and I'm not looking forward to that.

> > Which is why I'm asking. It might be Saxon or something in 
> > IKVM that leaks.
> 
> Or you just do not destroy your objects.... IIS + .NET is 
> known for its 
> late garbage collection, but when references stay open, it 
> won't garbage 
> collect at all.

Oh man, if only it were that simple. I've never written code the cleans
itself up so well as this app! I 'dispose' of every object and data
structure I use. I can say with reasonable certainty, it's not crappy code
in my .NET world. :-)

> > in IIS. It's the IIS worker process that grows until it 
> > get's too big and is recycled.
> 
> There are a zillion tools to track down memory leaks (try 
> google, both 
> free and commercial). But why trying the hard way when you can solve 
> things easily by switching gears?

I will look around for some tools.

Thanks again for your comments.

Bye for now
Jason.

Jason Timmins (Technical Director) InterLinx Ltd.
 Geo: West Mids, UK. Tele: +44 8707 430999. Fax: +44 8707 460999.
           Beyond here there be dragons. 


________________________________________________________________________
This email has been scanned for all viruses by the InterLinx Anti-Virus
Email service. For more information on a proactive anti-virus service
working around the clock, around the globe, visit
http://www.interlinx.co.uk/anti-virus-anti-spam.htm
________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.20 Memory Leak?

Posted by Abel Braaksma <ab...@xs4all.nl>.
Jason Timmins wrote:
>
> N-no, the problem is not with FOP, the problem is that I need to produce
> documents really quickly for high-volume PS printers. My .NET app produces
> the raw XML and uses Saxon to create the XLS and FOP to turn it into PS. The
> problem is that if I fire up the Java VM for Saxon and then again for FOP,
> document creation takes 7 seconds (way too slow.) If I turn those two
> packages into .NET assemblies and avoid the start-up delays of the Java VM,
> document creation times fall to 2 seconds as everything is in the same .NET
> execution environment.
>
> If you can tell me how to keep Saxon and FOP running whilst I push large
> amounts of XML documents through them, I'd gladly give it a try.
>   

You are making things way too complicated for yourself. FOP is a Java 
app, Saxon is a Java app (it is available as .NET but that's an 
automated port, not a .NET optimized version). Having two Java apps and 
calling them from IKVM makes things both slow and complicated at the 
same time. Unless there's a compelling need for you to use .NET for your 
transformations (you mention using IIS) why not call both Saxon and FOP 
by code? It's plain and simple, even when you have limited knowledge of 
Java. And you don't need to exit the JVM anymore. This has two main 
benefits: you gain speed (perhaps a lot!) and your application becomes 
easier.

And while your at it, you might as well upgrade to a newer version of 
FOP, since yours is really ancient.

> Which is why I'm asking. It might be Saxon or something in IKVM that leaks.
>   

Or you just do not destroy your objects.... IIS + .NET is known for its 
late garbage collection, but when references stay open, it won't garbage 
collect at all.

>   
>> Does .NET not have good tools to track down memory leaks?
>>     
>
> Not that I'm aware of. The problem is complicated by it running as a web app
> in IIS. It's the IIS worker process that grows until it get's too big and is
> recycled.
>   

There are a zillion tools to track down memory leaks (try google, both 
free and commercial). But why trying the hard way when you can solve 
things easily by switching gears?

HTH,
Cheers,
-- Abel Braaksma

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: FOP 0.20 Memory Leak?

Posted by Jason Timmins <ja...@interlinx.co.uk>.
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> Sent: 27 March 2008 11:13
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: FOP 0.20 Memory Leak?

Hi There,

> For performance reasons? In my tests, FOP is running slower 
> in IKVM than
> when it's run under a decent JVM. IKVM is fast but it brings some
> overhead into the picture.

N-no, the problem is not with FOP, the problem is that I need to produce
documents really quickly for high-volume PS printers. My .NET app produces
the raw XML and uses Saxon to create the XLS and FOP to turn it into PS. The
problem is that if I fire up the Java VM for Saxon and then again for FOP,
document creation takes 7 seconds (way too slow.) If I turn those two
packages into .NET assemblies and avoid the start-up delays of the Java VM,
document creation times fall to 2 seconds as everything is in the same .NET
execution environment.

If you can tell me how to keep Saxon and FOP running whilst I push large
amounts of XML documents through them, I'd gladly give it a try.

> I don't know of any memory leaks in 0.20.5. A lot of people 
> use (or used)
> that version in production with no problems.

Which is why I'm asking. It might be Saxon or something in IKVM that leaks.

> Does .NET not have good tools to track down memory leaks?

Not that I'm aware of. The problem is complicated by it running as a web app
in IIS. It's the IIS worker process that grows until it get's too big and is
recycled.

Bye for now
Jason.

Jason Timmins (Technical Director) InterLinx Ltd.
 Geo: West Mids, UK. Tele: +44 8707 430999. Fax: +44 8707 460999.
           Beyond here there be dragons. 


________________________________________________________________________
This email has been scanned for all viruses by the InterLinx Anti-Virus
Email service. For more information on a proactive anti-virus service
working around the clock, around the globe, visit
http://www.interlinx.co.uk/anti-virus-anti-spam.htm
________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.20 Memory Leak?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 27.03.2008 12:02:19 Jason Timmins wrote:
> Hi There,
> 
> I know all the talk is of FOP 0.9X and it's all pretty cool but my project
> is using good old 0.20.5.
> 
> For performance reasons, I've used IKVM to turn the FOP 0.20.5 binaries into
> .NET executables.

For performance reasons? In my tests, FOP is running slower in IKVM than
when it's run under a decent JVM. IKVM is fast but it brings some
overhead into the picture.

> I run it with a .NET version of Saxon to produce PDFs in
> large quantities. However, something is leaking memory at the rate of 1Mb
> per PDF and it's killing the web server.
> 
> I'm trying to understand whether it's FOP or Saxon or IKVM that's leaking so
> massively. One thing is certain, if I drop all the FOP/Saxon/IKVM the .NET
> code runs well and doesn't leak.
> 
> I wondered if you guys had any thoughts on this? Simply, does FOP 0.20.5
> leak memory when run continuously in the same execution environment?

I don't know of any memory leaks in 0.20.5. A lot of people use (or used)
that version in production with no problems.

Does .NET not have good tools to track down memory leaks?

> Cheers
> Jason.
> 
> Jason Timmins (Technical Director) InterLinx Ltd.
>  Geo: West Mids, UK. Tele: +44 8707 430999. Fax: +44 8707 460999.
>            Beyond here there be dragons.
> 
> 


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org