From: Tpt Date: Mon, 3 Dec 2012 21:03:53 +0000 (+0100) Subject: (bug 42466) Allow djvutxt to use more memory X-Git-Tag: 1.31.0-rc.0~21381^2~1 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=fcd9fbfbf835ab0031c331f892ae6f1098ba12f4;p=lhc%2Fweb%2Fwiklou.git (bug 42466) Allow djvutxt to use more memory The djvutxt utility of DjVuLibre 3.5.24 packed with Ubuntu 12.04 use a lot of memory more that the old version packed with Ubuntu 10.04. S, to work, the memory limit must be increased. User:Phe suggest that this increase of memory consumption is maybe caused by the loading of localisations file at the start of the tool. Change-Id: Ia735e1b7d71f5aa512fb14e444989854c440074e --- diff --git a/includes/media/DjVuImage.php b/includes/media/DjVuImage.php index e2fcaa932c..bdedbd1488 100644 --- a/includes/media/DjVuImage.php +++ b/includes/media/DjVuImage.php @@ -252,7 +252,7 @@ class DjVuImage { $cmd = wfEscapeShellArg( $wgDjvuTxt ) . ' --detail=page ' . wfEscapeShellArg( $this->mFilename ) ; wfDebug( __METHOD__.": $cmd\n" ); $retval = ''; - $txt = wfShellExec( $cmd, $retval ); + $txt = wfShellExec( $cmd, $retval, array(), array( 'memory' => 300000 ) ); wfProfileOut( 'djvutxt' ); if( $retval == 0) { # Strip some control characters