(bug 42466) Allow djvutxt to use more memory
authorTpt <thomaspt@hotmail.fr>
Mon, 3 Dec 2012 21:03:53 +0000 (22:03 +0100)
committerTpt <thomaspt@hotmail.fr>
Mon, 3 Dec 2012 21:03:53 +0000 (22:03 +0100)
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

includes/media/DjVuImage.php

index e2fcaa9..bdedbd1 100644 (file)
@@ -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