websvn icon indicating copy to clipboard operation
websvn copied to clipboard

Allowed memory size of 512MB bytes exhausted during diff

Open danielmarschall opened this issue 2 years ago • 8 comments

Looking through my log files with the latest version 2.8.3 , I noticed the following problem:

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 135168 bytes) in diff_util.php on line 68

The URL is: https://svn.viathinksoft.com/websvn/diff.php?path=/trunk/bin/webreader.phar&repname=vnag&rev=88

In case you need the SVN working copy: svn co https://svn.viathinksoft.com/svn/vnag

It is a bit surprising because webreader.phar is a rather small file. However, it is a binary file, so I guess the diff util goes crazy?

danielmarschall avatar Dec 19 '23 23:12 danielmarschall

Check this https://github.com/websvnphp/websvn/issues/128 I did not get time to work on it as after raising the memory limit but it didnt recur and was then not priotize.

k10blogger avatar Dec 23 '23 16:12 k10blogger

Stupid question: Does using diff(1) make any difference or is just the processing of a unified diff problematic in PHP itself?

michael-o avatar Dec 23 '23 20:12 michael-o

@michael-o You mean the "diff" command in Linux? I think it does not allow binary files to be diff'ed. I guess the PHP script levenshtein2 takes too much memory, because the files are too hard to diff, because they are either binary, or if they are "too much unequal"

danielmarschall avatar Dec 23 '23 21:12 danielmarschall

I am a bit confused. The file is are regular text file and this works: https://svn.viathinksoft.com/websvn/comp.php?repname=vnag&compare[]=%2Ftrunk%2Fbin%2Fwebreader.phar@88&compare[]=%2Ftrunk%2Fbin%2Fwebreader.phar@89

michael-o avatar Dec 23 '23 22:12 michael-o

...https://packagist.org/?query=levenstein

michael-o avatar Dec 23 '23 22:12 michael-o

@michael-o I don't know the internals of the algorithm, so I cannot help much.

About the PHAR files, I call them binary because they contain control characters in between which are not text. To be fair, a large portion of the PHAR files is text, though.

I do not know why diff.php crashes and comp.php not.

danielmarschall avatar Dec 23 '23 23:12 danielmarschall