Attached example performs an endless series of remote status against the
Subversion repository. When invoked with -Xmx24M, the VM will run out of
memory soon. Monitoring with jvisualvm shows that the used heap size
constantly grows. Monitoring with the Task Manager shows that the
allocated memory grows even more (significantly). Looks like a memory
leak, for which a large amount of native memory is involved, too.
Tested on Windows 8.1 with almost latest Subversion 1.9 JavaHL builds.
-Marc
import java.io.*;
import org.apache.subversion.javahl.*;
import org.apache.subversion.javahl.callback.*;
import org.apache.subversion.javahl.remote.*;
import org.apache.subversion.javahl.types.*;
public class RemoteStatusMain {
// Static
=================================================================
public static void main(String[] args) throws Exception {
final RemoteFactory remoteFactory = new RemoteFactory();
for (;;) {
System.out.println("\n\n\n");
final ISVNRemote remote =
remoteFactory.openRemoteSession("http://svn.apache.org/repos/asf/subversion/branches/1.8.x");
try {
final ISVNReporter status = remote.status("/",
Revision.SVN_INVALID_REVNUM, Depth.infinity, new MyRemoteStatus());
try {
status.setPath("", 1660000,
Depth.infinity, false, null);
status.finishReport();
}
finally {
status.dispose();
}
}
finally {
remote.dispose();
}
}
}
// Inner Classes
==========================================================
private static class MyRemoteStatus implements RemoteStatus {
@Override
public void addedDirectory(String relativePath) {
System.out.println("A D " + relativePath);
}
@Override
public void addedFile(String relativePath) {
System.out.println("A F " + relativePath);
}
@Override
public void addedSymlink(String relativePath) {
System.out.println("A S " + relativePath);
}
@Override
public void modifiedDirectory(String relativePath, boolean
childrenModified, boolean propsModified, Entry nodeInfo) {
System.out.println("M D " + relativePath + " " +
childrenModified + " " + propsModified);
}
@Override
public void modifiedFile(String relativePath, boolean
textModified, boolean propsModified, Entry nodeInfo) {
System.out.println("M F " + relativePath + " " +
textModified + " " + propsModified);
}
@Override
public void modifiedSymlink(String relativePath, boolean
targetModified, boolean propsModified, Entry nodeInfo) {
System.out.println("M S " + relativePath + " " +
relativePath + " " + targetModified);
}
@Override
public void deleted(String relativePath) {
System.out.println("D " + relativePath);
}
}
}