You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Sunil Shetye <sh...@bombay.retortsoft.com> on 2004/10/28 08:45:34 UTC

"Cannot allocate memory" error for "svn diff"

Hi,

"svn diff" fails when run with many filenames (more than 130 or so).

$ svn diff -r 41899:41900
[ no errors ]

$ svn diff -r 41899:41900 file001 file002 ... file150
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///my/repos/trunk/file053'
svn: Berkeley DB error while opening 'nodes' table for filesystem /my/repos/db:
Cannot allocate memory
svn: bdb: Logging region out of memory; you may need to increase its size

The same error occurs even if all the files listed have not changed at
all in between the revisions specified!

After the error, many commands like "svn ci" and "svn up" work
normally. However, "svnadmin hotcopy" and "svnadmin recover" do not
work.

$ svnadmin recover /my/repos
Repository lock acquired.
Please wait; recovering the repository may take some time...
svn: DB_RUNRECOVERY: Fatal error, run database recovery
svn: bdb: Logging region out of memory; you may need to increase its size
svn: bdb: Recovery function for LSN 5316 3252932 failed on backward pass
svn: bdb: PANIC: Cannot allocate memory
svn: bdb: PANIC: fatal region error detected; run recovery
[ last line repeated 1662 times! ]

[ what should one do if "svnadmin recover" tells one to run recovery? ]

Luckily, "svnadmin dump" was still working, so I recovered the
repository using hotcopy + incremental dump. I increased set_lg_max to
40Mb (41943040) and set_lg_bsize to 10Mb (10485760) in
/my/repos/db/DB_CONFIG and ran "svnadmin recover". [Is there any way
of knowing if the new values have been used during recovery?]
Repeating the above "svn diff" command gave the same error.

Version info:
System:            linux
subversion:        1.1.0
db4:               4.2.52 + 2 patches
repository access: file:// protocol

-- 
Sunil Shetye.

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

"Too many open files" for "svn diff" [Was: Re: "Cannot allocate memory" error for "svn diff"]

Posted by Sunil Shetye <sh...@bombay.retortsoft.com>.
=============================================================================
Thanks for the help. It has not solved the problem completely though.

Quoting from J Robert Ray's mail on Thu, Oct 28, 2004 at 04:14:40PM -0700:
> Increasing set_lg_max and set_lg_bsize didn't work for me, until I added 
> the set_cachesize and set_lg_regionmax settings (see link) I couldn't 
> get recover to succeed.

Increasing set_lg_regionmax did make "svnadmin recover" succeed. It
also changed the error message for the original "svn diff" command.
Setting set_cachesize did not make any difference.

Since the source of the problem appears to be different now, I am
repeating the problem.
=============================================================================

"svn diff" fails when run with many filenames (more than 60 or so if
"ulimit -n" is 1024).

$ svn diff -r 41899:41900 file001 file002 ... file150
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///my/repos/trunk/file057'
svn: Berkeley DB error while opening 'transactions' table for filesystem /my/repos/db:
Too many open files
Aborted

The problem seems to be related to db files being opened repeatedly
and not closed. Here is the partial output of ltrace:

======
SYS_open("/my/repos/locks/db.lock", 0, 0666)                                    = 3
SYS_open("/my/repos/db/nodes", 32770, 00)                                       = 4
SYS_open("/my/repos/db/revisions", 32770, 00)                                   = 5
SYS_open("/my/repos/db/transactions", 32770, 00)                                = 6
SYS_open("/my/repos/db/copies", 32770, 00)                                      = 7
SYS_open("/my/repos/db/changes", 32770, 00)                                     = 8
SYS_open("/my/repos/db/representations", 32770, 00)                             = 9
SYS_open("/my/repos/db/strings", 32770, 00)                                     = 10
SYS_open("/my/repos/db/uuids", 32770, 00)                                       = 11
======
SYS_open("/my/repos/locks/db.lock", 0, 0666)                                    = 12
SYS_open("/my/repos/db/nodes", 32770, 00)                                       = 13
SYS_open("/my/repos/db/revisions", 32770, 00)                                   = 14
SYS_open("/my/repos/db/transactions", 32770, 00)                                = 15
SYS_open("/my/repos/db/copies", 32770, 00)                                      = 16
SYS_open("/my/repos/db/changes", 32770, 00)                                     = 17
SYS_open("/my/repos/db/representations", 32770, 00)                             = 18
SYS_open("/my/repos/db/strings", 32770, 00)                                     = 19
SYS_open("/my/repos/db/uuids", 32770, 00)                                       = 20
======
SYS_open("/my/repos/locks/db.lock", 0, 0666)                                    = 21
SYS_open("/my/repos/db/nodes", 32770, 00)                                       = 22
SYS_open("/my/repos/db/revisions", 32770, 00)                                   = 23
SYS_open("/my/repos/db/transactions", 32770, 00)                                = 24
SYS_open("/my/repos/db/copies", 32770, 00)                                      = 25
SYS_open("/my/repos/db/changes", 32770, 00)                                     = 26
SYS_open("/my/repos/db/representations", 32770, 00)                             = 27
SYS_open("/my/repos/db/strings", 32770, 00)                                     = 28
SYS_open("/my/repos/db/uuids", 32770, 00)                                       = 29
======
SYS_open("/my/repos/locks/db.lock", 0, 0666)                                    = 30
SYS_open("/my/repos/db/nodes", 32770, 00)                                       = 31
SYS_open("/my/repos/db/revisions", 32770, 00)                                   = 32
SYS_open("/my/repos/db/transactions", 32770, 00)                                = 33
SYS_open("/my/repos/db/copies", 32770, 00)                                      = 34
SYS_open("/my/repos/db/changes", 32770, 00)                                     = 35
SYS_open("/my/repos/db/representations", 32770, 00)                             = 36
SYS_open("/my/repos/db/strings", 32770, 00)                                     = 37
SYS_open("/my/repos/db/uuids", 32770, 00)                                       = 38
======
...

-- 
Sunil Shetye.

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

Re: "Cannot allocate memory" error for "svn diff"

Posted by J Robert Ray <jr...@imageworks.com>.
Sunil Shetye wrote:
> Hi,
> 
> "svn diff" fails when run with many filenames (more than 130 or so).
> 
> $ svn diff -r 41899:41900
> [ no errors ]
> 
> $ svn diff -r 41899:41900 file001 file002 ... file150
> svn: Unable to open an ra_local session to URL
> svn: Unable to open repository 'file:///my/repos/trunk/file053'
> svn: Berkeley DB error while opening 'nodes' table for filesystem /my/repos/db:
> Cannot allocate memory
> svn: bdb: Logging region out of memory; you may need to increase its size

Please see this message:

http://www.contactor.se/~dast/svnusers/archive-2004-10/1001.shtml

> $ svnadmin recover /my/repos
> Repository lock acquired.
> Please wait; recovering the repository may take some time...
> svn: DB_RUNRECOVERY: Fatal error, run database recovery
> svn: bdb: Logging region out of memory; you may need to increase its size
> svn: bdb: Recovery function for LSN 5316 3252932 failed on backward pass
> svn: bdb: PANIC: Cannot allocate memory
> svn: bdb: PANIC: fatal region error detected; run recovery
> [ last line repeated 1662 times! ]
> 
> [ what should one do if "svnadmin recover" tells one to run recovery? ]
> 
> Luckily, "svnadmin dump" was still working, so I recovered the
> repository using hotcopy + incremental dump. I increased set_lg_max to
> 40Mb (41943040) and set_lg_bsize to 10Mb (10485760) in
> /my/repos/db/DB_CONFIG and ran "svnadmin recover". [Is there any way
> of knowing if the new values have been used during recovery?]
> Repeating the above "svn diff" command gave the same error.

Increasing set_lg_max and set_lg_bsize didn't work for me, until I added 
the set_cachesize and set_lg_regionmax settings (see link) I couldn't 
get recover to succeed.

- Robert

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