You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Manuel Freiholz INT <m....@cadenas.de> on 2006/02/13 08:16:27 UTC

[BUG?] javahl-1.3 -> streamFileContent

Hope im right here for Bug reporting - i apoligize when not :)

--
In the new method 'streamFileContent' of the svn-javahl 1.3 must be a 
memory leak. I tried to use this method for an download over a servlet 
and i always get a 'Java heap space' ( BIG FILES ONLY <-important, try 
with files like 200MB). I discuss on forums about many ways to use this 
method, but not one way wors correctly. So we though there must be a leak.

I think the leak is in the native file:
[ SVNClient.cpp - Line 2405 ]
--
  while (contentSize > 0)
  {
      size_t readSize = bufSize > contentSize ? contentSize : bufSize;
      Err = svn_stream_read(read_stream, (char *)bufData, &readSize);
      if (Err != NULL)
      {
          env->ReleaseByteArrayElements(buffer, bufData, 0);
          svn_stream_close(read_stream);
          JNIUtil::handleSVNError(Err);
          return;
      }

      env->ReleaseByteArrayElements(buffer, bufData, JNI_COMMIT);
      env->CallVoidMethod(outputStream, writeMethod, buffer, 0, readSize);
      if (JNIUtil::isJavaExceptionThrown())
      {
          env->ReleaseByteArrayElements(buffer, bufData, 0);
          svn_stream_close(read_stream);
          return;
      }
      contentSize -= readSize;
  }
--

I think this must be the 'bug'.

Best Regards,
- Manuel



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org