mildlyincoheren
05-02-2006, 09:56 AM
I've been putting together a small pet project. Once it was finished i realised it had a gigantic memory leak inside of it. I tried to read up on the subject, but couldn't find the source of the problem via the articals.
This site is very simple, so I'd think idenifying (and hopefully fixing) the problem would be easy. Here is the relavent portions of JS (followed by links to the full page incase you need to see that):
<input value="Run" onclick="parent.script.location='script.php'" type="button">
. . .
<form name="runCount"><input size="10" name="totalClicks" align="center" type="text" value="0"></form>
var grabVal=parseFloat(parent.main.document.runCount.totalClicks.value);
grabVal = grabVal + .25;
parent.main.document.runCount.totalClicks.value=grabVal;
<?php
$lines = file('urls.txt');
$line_number = mt_rand(0,sizeof($lines)-1);
$killreturn=$lines[$line_number];
$location=str_replace("\n", "", $killreturn);
$location=str_replace("\r", "", $location);
print "parent.change.location=\"$location\";";
?>
The php just selects a random webpage for the "change" frame to be redirected to.
I also have adbrite code installed which uses JS, but the page still leaks like crazy even with it removed.
Incase you need more sorounding information here are the URLs you can directly access the project with:
http://gaiabot.awardspace.com/index.html (frame set)
http://gaiabot.awardspace.com/main.html (main body)
http://gaiabot.awardspace.com/script2.txt (source code of script.php so you can actually read it).
Any help would be very very much appreciated!
Thanks,
--Paolo
This site is very simple, so I'd think idenifying (and hopefully fixing) the problem would be easy. Here is the relavent portions of JS (followed by links to the full page incase you need to see that):
<input value="Run" onclick="parent.script.location='script.php'" type="button">
. . .
<form name="runCount"><input size="10" name="totalClicks" align="center" type="text" value="0"></form>
var grabVal=parseFloat(parent.main.document.runCount.totalClicks.value);
grabVal = grabVal + .25;
parent.main.document.runCount.totalClicks.value=grabVal;
<?php
$lines = file('urls.txt');
$line_number = mt_rand(0,sizeof($lines)-1);
$killreturn=$lines[$line_number];
$location=str_replace("\n", "", $killreturn);
$location=str_replace("\r", "", $location);
print "parent.change.location=\"$location\";";
?>
The php just selects a random webpage for the "change" frame to be redirected to.
I also have adbrite code installed which uses JS, but the page still leaks like crazy even with it removed.
Incase you need more sorounding information here are the URLs you can directly access the project with:
http://gaiabot.awardspace.com/index.html (frame set)
http://gaiabot.awardspace.com/main.html (main body)
http://gaiabot.awardspace.com/script2.txt (source code of script.php so you can actually read it).
Any help would be very very much appreciated!
Thanks,
--Paolo