Richard Ev
Richard Ev

Reputation: 54127

"out of memory - terminating application" error when performing an svn merge

We are seeing the following error when trying to perform a command-line svn merge with Subversion 1.6.9 under 32 bit Windows XP.

Out of memory - terminating application.

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

Inspecting Windows task manager around this time reveals the following memory usage

Memory usage spike

The peak memory usage of the svn.exe process is in excess of 1.8GB.

As an aside, we get the same result when trying to perform the merge using TortoiseSVN.

We are trying to perform the merge from the root level of our repository. The total file size (on a developer machine) of the repository is around 3GB.

This is the first time that we are attempting a root-level merge. Are we hitting an internal svn limit?

Edit

After some trial-and-error investigation I've found that this problem seems to be caused by one specific folder in our repository. This folder contains 1,500 SQL scripts. Performing a merge on just this folder results in the same out of memory error (although it takes longer to blow up).

Upvotes: 3

Views: 4473

Answers (3)

Richard Ev
Richard Ev

Reputation: 54127

We were able to fix this issue, though we still don't understand the precise nature of the cause.

As stated in my post Edit, we tracked the issue to a single folder that contained around 1500 SQL scripts. This folder also had an svn:externals of a single file.

We performed the following steps:

  • deleted this svn:externals and did an svn commit
  • deleted the working copy of the folder (there seems to be an issue whereby if you remove an svn:externals property that referenced a single file that the file that was external'd into the folder does not get removed on a subsequent svn update)
  • performed an svn update

When we next attempted an svn merge the command completed successfully.

Upvotes: 4

Joshua McKinnon
Joshua McKinnon

Reputation: 24719

Given the memory usage you're seeing (~1.8GB) prior to termination and the fact you are on 32-bit Windows, which has a 2GB memory limit per process, I'd recommend attempting the merge on a 64-bit machine.

If you don't have a 64-bit machine available, try breaking it up into smaller merges (unless you're reintegrating a branch, then I'm not sure how you'd split that up).

I've dealt with 3GB working copies and lots of merging (always from the root of the branch) - I've never hit a memory issue, but I've also been 64-bit for a long time. It's conceivable that merging a branch with a lot of changes could require a lot of memory, but I'm just speculating.

I suggest posting to the subversion mailing list, and a quick search tells me you already have :) I suspect they will confirm that you need more memory to do a big merge given the size of the repository, but it's also possible something else is going on.

Separate suggestion: search the mailing list for similar problems.

I found a thread about too many mergeinfo properties causing increased memory usage. If you've never merged from the root before, I assume you have a lot of mergeinfos.

UPDATED: It's important to understand what svn:mergeinfos are. Exercise caution in removing them without some understanding. In Richard's case, the repository never had merges committed from the root of the branches, which means svn:mergeinfo at the root probably did not contain anything, so removing them all will remove svn's knowledge of what was previously merged. This matters when doing full branch merges (e.g. svn merge url/to/src/branch - where no revision is specified), and may cause subversion to try to re-merge revisions that were previously merged. Cherry-pick merges (i.e. specifying revisions x,y,z) should not be affected. Even if it's all removed, it isn't the end of the world it's just you'll have an svn 1.4 like behavior for whole branch merges that involve branches before that point in time.

That said, I've had to clean up extraneous subtree mergeinfos multiple times before - just not from the root.

Mergeinfo recommended reading:

Upvotes: 2

Ben
Ben

Reputation: 35643

Are you running a 64bit build of SubVersion on 64bit windows?

If not please bear in mind the restriction on memory size in Windows. You are restricted to 3GB for the use of the process, so that may be the limit you are hitting.

By the way the latest TortoiseSVN is 1.6.13

Upvotes: 0

Related Questions