If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Possible memory leak when page is continuously refreshed via jQuery.post




6 years ago
5 years ago


(Reporter: Shilo Ayalon, Unassigned)


11 Branch
Windows 7

Firefox Tracking Flags

(Not tracked)




6 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.4 (KHTML, like Gecko) Chrome/19.0.1077.3 Safari/536.4

Steps to reproduce:

Wrote a simple app that did the following:
1. Client makes an interval request (every 10 sec) to the server.
2. Server returns about ~1MB of html to the client in JSON format.
3. Client loads the returned html to a hidden div in the page (replacing the same div's content on each reload).

Test client was Firefox 11.0 on Windows 7. Test server was Sinatra app on Ubuntu linux 10.04. See this URL for specific code:


Actual results:

The memory consumed by the Firefox process kept increasing in an amount not proportional to the data added (1MB returned lead to 10's of MB memory increase on each page refresh). Observed using Task Manager and Windows Memory Diagnostic tool. Eventually the machine tested ran out of memory (it wasn't too strong to begin with).

Expected results:

Nothing. The memory consumed by FF should have remained more or less the same, within STDEV, assuming no other actions were taken on the client machine.

Comment 1

6 years ago
Thanks for taking time to report this!

I don't see the 10MB per load increase with this 1MB HTML on a Mac Nightly build: http://www.gutenberg.org/files/39250/39250-h/39250-h.htm , although I do see it with http://www.whatwg.org/specs/web-apps/current-work/ . Since you didn't provide your HTML, could you try with the gutenberg page I linked to (I used Save as.. Web page, HTML only) and report the results?

Does your HTML have <script>s in it?
Whiteboard: [closeme 2012-04-30]

Comment 2

6 years ago
Please note that this bug was observed on FF 11.0 (and below) running on Windows 7.

The HTML file is a very large <table> containing many values, a lot of white spaces (generated via template engine) and a little bit of inline CSS for each row. There are no <script> tags, but there are many links of the form <a href="javascript:callSomeFunction(..)">some text</a>. 

I'll test the gutenberg page and post the results here (might not be until the beginning of next week, as I'm away from the office for a few days).

Thanks for your help!

Comment 3

6 years ago
Thanks! If you can't reproduce with the gutenberg page, we'll need the HTML code to reproduce the issue. You could zip it up and attach here if it's not confidential or (better) adapt the server-side code to create a simpler version of the table that can be used to reproduce the issue.

The reason I asked about <script>s is that the scripts are not unloaded when a <script> is removed from the DOM. <a href="..."> and inline CSS should be, I think.

Comment 4

6 years ago
Hi - sorry it took me a week to respond, we had some internal IT issues. I was able to reproduce the issue with the gutenberg page.

Comment 5

6 years ago
Hm. Do you test in a new profile? Please try that if you don't: http://support.mozilla.org/en-US/kb/Managing-profiles#w_creating-a-profile

Could you attach the files that can be used to reproduce the problem, since I still can't reproduce, even on Firefox 11.
OS: Linux → Windows 7

Comment 6

6 years ago
Just to verify - you're trying this on Firefox 11.0 with Windows 7? I was unable to create a new profile on Windows - firefox.exe doesn't seem to provide the command line flags in the link you provided.

I'm not sure how much more I could be of help. The gutenberg HTML reproduced the issue with the sample app I wrote about. The HTML I originally used contains confidential organization data, but like I said, it's basically just a very large <table>.

Comment 7

6 years ago
I tested on a Mac, since I don't have a Windows 7 system to test on.

So this is OS-specific, specific to your system/firefox profile, or we're not testing the same thing. Based on past experience, my bet is on one of the last two options, in which case it's unlikely this will be resolved without your further help.

If you're interested in figuring this out, I suggest you test with an empty profile and provide as specific steps to reproduce as possible, or test on a different system, if you can. (If you need help figuring out how to get the profile manager running, feel free to mail me or get someone on irc.mozilla.org to help you.)

If you would not like to spend more time on this, that's fine too. Thanks for the time you've already spent and sorry I couldn't reproduce!

Comment 8

6 years ago
My company is flooded with Win7 computers. I'll set up an internal test server with the benchmark app and have 4-5 people follow up on their machines. This might take a week or so.

Here's what I did to try and get the profile manager running on windows:
1. Open cmd (Start > Run > cmd).
2. cd into Firefox's folder (C:\Program Files (x86)\Mozilla Firefox)
3. run "firefox.exe -P".
Nothing happened. I also tried Windows' PowerShell and passing other flags, including windows style flags (--help, -h, /P, /?, /help, and many more. It was sad). I'm also a linux/mac guy, so this is annoying to me as well :)

If we can reproduce this and you still cannot (virtualbox/parallels on Mac, perhaps?), I'll try and figure out a way to get you the HTML I'm using.

If this is an actual bug, I'll be glad to have helped out any way I can.

Comment 9

6 years ago
4-5 people is overkill (after one independent confirmation my main suspicion would be that I'm not following the right steps to reproduce). It would be best anyway if you got the profile manager working. Are you sure you run "firefox.exe -P" when all other firefox.exe processes are closed (in the task manager)?

I did try reproducing on WinXP I have in parallels (Fx11), and it was working fine too.

BTW, I just realized I didn't ask your for an about:memory dump, it might be possible to troubleshoot the problem based on that. Could you type about:memory into the location bar when the memory usage is much higher than normal after running your testcase for a while, then copy/paste it here?
please reopen if you get more info
Last Resolved: 5 years ago
Resolution: --- → INCOMPLETE
Whiteboard: [closeme 2012-04-30]
You need to log in before you can comment on or make changes to this bug.