OutOfMemoryError during SVNRepository.replay()

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

OutOfMemoryError during SVNRepository.replay()

Thomas Mauch
Hi

I use SVNKit to replay changes in a SVN repository.
From time to time, I get OutOfMemory errors.
I attach a report MemoryAnalyerReport.pdf created by the Eclipse Memory Analyzer which seems to indicate that SVNKit tries to read a huge XML document as a whole in the memory.
Is there a way to change this behavior or is this a known issue?

Many thanks,
Thomas
Reply | Threaded
Open this post in threaded view
|

Re: OutOfMemoryError during SVNRepository.replay()

Alexander Kitaev-4
Hello Thomas,

This looks pretty strange.

When REPORT request is sent to the server (in this case by 'replay'
operation), then server response is read back from a stream which is
passed to the SAX parser instance. This SAX parser is expected to
parse XML by reading it from the stream, and while parsing it is not
expected to accumulate any large amount of data (no more than 100 kbs
when constructing delta segements). Instead SAX parsers calls replay
handler instance which constructs lightweigh objects and uses
ISVNEditor to "replay" a commit.

In other words, this is unexpected behaviour and no OOME should happen
by design.

A few questions:

1. What version of the JVM do you use? SAX parser is part of JDK, so
upgrading to the newer JDK may resolve the problem.
2. Is ISVNEditor instance passed to SVNRepository.replay(...) method
ever called?

Thanks!

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
http://hg4j.com/ - Java Mercurial Library!
http://sqljet.com/ - Java SQLite Library!



On 18 October 2011 08:23, Thomas Mauch <[hidden email]> wrote:

>
> Hi
>
> I use SVNKit to replay changes in a SVN repository.
> From time to time, I get OutOfMemory errors.
> I attach a report
> http://old.nabble.com/file/p32672530/MemoryAnalyerReport.pdf
> MemoryAnalyerReport.pdf  created by the Eclipse Memory Analyzer which seems
> to indicate that SVNKit tries to read a huge XML document as a whole in the
> memory.
> Is there a way to change this behavior or is this a known issue?
>
> Many thanks,
> Thomas
>
> --
> View this message in context: http://old.nabble.com/OutOfMemoryError-during-SVNRepository.replay%28%29-tp32672530p32672530.html
> Sent from the SVNKit - Users mailing list archive at Nabble.com.
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: OutOfMemoryError during SVNRepository.replay()

Thomas Mauch
It was obviously a bug in the Xerces SAX parser bundled with JDK 1.6.0_24 I was using.
When the SAX parser was reused, it could happen that it collected the whole XML document interally because the parser thought it would still be reading the DTD.
Placing Xerces version 2.11 in the classpath or using JDK 1.7.0_01 solved the problem.

Thomas