Severe JS memory leak - can someone confirm?

Luciano Montanaro konq-e@mail.kde.org
Thu, 17 Oct 2002 14:43:15 +0200


--Boundary-00=_jBrr918/awVJqmO
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Content-Description: clearsigned data
Content-Disposition: inline

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alle 09:23, giovedì 17 ottobre 2002, Simon Hausmann ha scritto:

> I think it's unrelated to khtmlview. The JS engine in kde2 had its
> fair share of problems with the garbage collector, as far as I know.
> It works MUCH better in the kde3 codebase.
>
> What does everyone think about switching to QT3 and KDE3 khtml/kjs
> as codebase?
>

There surely are problems in the JS garbage collector.
The example code attached also leaks a lot.
The KDE3 kjs/khtms seems to be much better (particularly the js engine)
although it is quite a bit larger. My sample code works well in KDE3, too.
I tried backporting just the garbage collector, but it's not easily doable,
since the problem seem to be related to the object model of the Javascript
engine rather than the garbage collector itself. 

- -- 
Luciano Montanaro// Public GPG Key at wwwkeys.pgp.net      /"\ ASCII RIBBON
               \X/ luciano.montanaro@consulenti.fastweb.it \ /   CAMPAIGN
                                                            X  AGAINST HTML 
                                                           / \     MAIL
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9rrBqaeOY6B53J4URAq9eAJ9ZbU2Fh7UaXoQ7F0jJXaN3Qi+ktwCcC+Ny
qTVZnK3iqn31G3zPa/W7dx4=
=XMrW
-----END PGP SIGNATURE-----

--Boundary-00=_jBrr918/awVJqmO
Content-Type: text/html;
  charset="iso-8859-1";
  name="prova_clock.html"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="prova_clock.html"

<html>
	<head>
		<title>Prova clock</title>
		<script>
			function init() {
				setInterval("getCurrentTime()", 50);
			}
			function getCurrentTime() {
				var d = new Date();
				document.getElementById('clock').innerHTML = 
					d.toLocaleTimeString();
				delete d;
			}
		</script>
	</head>
	<body onload="init()"> 
		<h1>Prova di funzionamento orologio</h1>
		<div id="clock">Clock
		</div>
		<div id="seguito">
			<p>Qui c'e` il resto...</p>
			<button onclick="getCurrentTime()">Premimi</button>
		</div>
	</body>

			

--Boundary-00=_jBrr918/awVJqmO--