Repeated location.reload() makes the "slow script" dialog ineffective (and starves GC/CC?)
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: bsterne, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: crash, reproducible, testcase, Whiteboard: [sg:dos][oom])
Attachments
(1 file)
121 bytes,
text/html
|
Details |
Comment 2•14 years ago
|
||
Comment 3•14 years ago
|
||
Comment 4•14 years ago
|
||
Comment 5•13 years ago
|
||
Comment 6•13 years ago
|
||
Updated•13 years ago
|
Comment 7•13 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 9•6 years ago
|
||
I think the problem here is, that the above script is an exponential call?
Today I programmed a loop like this (which is, in fact very similar to the example):
while (true) {
var foo = [];
for (var bar = 0; bar < 100; bar++) {
// Allocate some memory --> Makes the effect faster
foo[bar] = Math.random();
}
// Use something from the calculated (will it be optimized away otherwise?)
foo = (foo[Math.floor(Math.random() * Math.floor(99))]);
// Now do a reload
window.location.reload();
// Program is executed after the reload --> exponential
alert("Hello World!");
}
In my opinion, the execution of the programm should stop after the reload(). But it does not (the "alert(..)" will trigger), so for me is not clear when which of the scripts is running (the reloading should IMHO stop the old script completely and create a new instance, so the alert will never trigger).
I cannot reproduce it for now, but not only the "Stop" button was unusable, also closing the tab didn't stop the allocation of new memory. Only killing firefox does help (but if you wait long enough, your OS will do that for you).
Updated•3 years ago
|
Comment 10•3 years ago
|
||
(In reply to Thomas Pfister from comment #9)
In my opinion, the execution of the programm should stop after the reload(). But it does not (the "alert(..)" will trigger), so for me is not clear when which of the scripts is running (the reloading should IMHO stop the old script completely and create a new instance, so the alert will never trigger).
location.reload()
is asynchronous, so it isn't meant to immediately stop execution of the calling script. Navigation attempts while there is a nested event loop for a modal dialog are a bit of an ugly corner case. I'll look into what happens here, though I'm not sure it's really the same as the originally reported bug.
Updated•2 years ago
|
Description
•