Forum archive 2000-2006

Arnold K. Pizer - memory leak and l2hPrecreateSet.pl

Arnold K. Pizer - memory leak and l2hPrecreateSet.pl

by Arnold Pizer -
Number of replies: 0
inactiveTopicmemory leak and l2hPrecreateSet.pl topic started 2/10/2001; 2:28:59 PM
last post 3/29/2001; 8:41:23 PM
userArnold K. Pizer - memory leak and l2hPrecreateSet.pl  blueArrow
2/10/2001; 2:28:59 PM (reads: 1607, responses: 3)
For the past several versions WeBWorK has had a small memory leak. Mike has worked very hard to find and fix this (so far without total success). This memory leak is (or at least was) inconsequential but would for example become important if WeBWorK were running under mod_perl.

This past week for the first time I had a problem with a memory leak when using l2hPrecreateSet.pl. We are not sure if this is the same problem or a new one. Others have also noticed this. Until we find and correct this bug, if you have a problem with this, here is one option.

Use the new version of l2hPrecreateSet.pl and select a range of psvn's to build. E.g. build sets for only half the students at one time.

Note this memory leak is a problem with WeBWorK (or with some perl component WeBWorK calls), not with LaTeX2html. It you run l2hPrecreateSet.pl on a set where all the problems have already been been precreated (so that LaTeX2html never gets called), you will still have the problem with memory growth.

<| Post or View Comments |>


userZbigniew Fiedorowicz - Re: memory leak and l2hPrecreateSet.pl  blueArrow
2/10/2001; 10:07:21 PM (reads: 1897, responses: 1)
Hi Arnie,

What symptoms of memory leakage should we look out for?

Is it the doubling bug with file paths for image files that Andy reported? Or is it something else?

Zig

<| Post or View Comments |>


userArnold K. Pizer - Re: memory leak and l2hPrecreateSet.pl  blueArrow
2/11/2001; 9:07:38 AM (reads: 2204, responses: 0)
The memory leak when runing l2hPrecreateSet.pl is very real and is something I didn't notice with version 1.5. In one trial with 2000 problems (2000 students and 1 problem), memory usage went up to 275MB. To check on memory usage, run the unix "top" command while the l2hPrecreateSet.pl script is running.

Using the new version of l2hPrecreateSet.pl allows you to easily breakup big l2hPrecreateSet jobs into smaller pieces. This is a solution to the memorary leak bug until we fix the bug. It is also useful for other purposes. If enought people want this new version, I'll post it as an update.

The doubling bug with file paths for image files that Andy reported is not something to be concerned with. We don't know what casued this error. Andy couldn't repeat it and this feature is being used literally millions of times by all WeBWorK users and no one else has reported such a problem. This type of error could be caused by setting the wrong $courseTempURL in the webworkCourse.ph file but then this would effect everyone in the course.

<| Post or View Comments |>


userArnold K. Pizer - Re: memory leak and l2hPrecreateSet.pl  blueArrow
3/29/2001; 8:41:23 PM (reads: 1858, responses: 0)
Patch for Memory leak in l2hPrecreateSet.pl and l2hPrecreateProb.pl.

Here is a patch for the memory leak in these two scripts which reside in the .../system/scripts subdirectory. The patch was contributed by Prof. Bill Wheeler of Indiana University. Thanks Bill.

Around lines 112-113 of BOTH scripts add the patch:

 



###############################################
# Create problem text
###############################################
my %envir=defineProblemEnvir($mode,$ii,$psvn,$courseID,@saveSubmittedAnswerList);



############## New Code contributed by Bill Wheeler ############
### to fix memory leak
my $pid=fork();
if ($pid) {wait ;}
else {
############## End of New Code contributed by Bill Wheeler ######



my $pt = new PGtranslator; #pt stands for problem translator;
$pt->environment(%envir);
$pt->initialize();



and arround lines 128-9 of BOTH scripts add the patch:

	        ## remove any links to gifs. These are not needed and when created by a script run from
## the command, they are invalid if the webserver is in a chroot enviroment
unlink(<$tempDirectory/gif/*${psvn}-set${setNumber}-prob${ii}-*>);



############## New Code contributed by Bill Wheeler ######
exit(0);
}
###### End of New Code contributed by Bill Wheeler ######



}
}



<| Post or View Comments |>