Closed Bug 1587654 Opened 4 months ago Closed 2 months ago

Memory leak/does not get released in main process when Save Image as/CTRL+S opens a folder with many images/thumbnails


(Firefox :: Untriaged, defect)

70 Branch
Not set





(Reporter: fxyyddr21, Unassigned)


(Whiteboard: [MemShrink:P3])


(1 file)

Attached file memory-report.json.gz

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

  1. point ctrl+S or save image as to a folder with many thumbnails/images (folder i use has over 5000 images) so it opens to this folder on the next CTRL+S press.
  2. find a image on the web,
  3. press CTRL+S, close it, open it again, multiple times each time around 70-100mb memory gets allocated to main firefox process that doesn't get cleaned up when doing a manual garbage collection in about:memory
  4. do this enough times, and firefox main process will consume around 7+Gb memory that only some of it will be released, in my case only around 300mb got released from 7Gb to 6.7Gb

Actual results:

Main process memory usage increases without end each time ctrl+S is opened in a folder with lots of images/thumbnails leading in the end to unresponsive ui, and possible crash.

Expected results:

Memory usage should not endlessly increase

I attached a memory report but it clearly looks like it's reported as main process other measurements private

I'm unsure but i think it maybe started happening some builds ago,

Whiteboard: [MemShrink]

Hi Thomas,

I was unable to reproduce the issue reported on Firefox Nightly 72.0a1 (2019-10-22) (64-bit) on Windows 10 Pro.

I'll need info Mike Conley who may be able to help with memory leak interpretation.

In the meantime, can you try the following?


Flags: needinfo?(mconley)
Flags: needinfo?(fxyyddr21)

Hi Thomas,

If you disable your add-ons (Help > Restart with Add-ons Disabled), are you still able to reproduce the issue?

In the memory report you posted in comment 0, did you have many tabs open when you took the capture?

Flags: needinfo?(mconley)

I can reproduce it with a clean profile, and my current profile with all addons disabled on the latest nightly.

On the memory report the only tab open was a picture that i just CTRL+S many times to the folder that seems to trigger it, it also seems that it doesn't just happen in folders with many thumbnails/images but also when there is only 1 image with the folder set to view > Large icon, the memory increase is smaller around 10mb each time only instead of 60-80mb on the big folder.

Curiously it seems that on the folder with many images which i have the memory goes up no matter what View settings are set to, I wonder if it's a possibility that this a windows memory leak instead, windows build that i use is 1903/20H1

is there anything i can do to capture the event when it happens, as i can reproduce it on a clean profile.

Flags: needinfo?(fxyyddr21)

Hmm i think i was correct in that it seemed to be a windows memory leak, as i have updated my windows version, and know when i close the save dialog memory seems to be correctly released, but i will continue to monitor it, and see if it happens again.
The windows build that i was on where it happened was the recently released 1909 RTM release, the memory leak doesn't seem to happen on the fast ring build i just updated to check if windows was actually the reason for the memory leak.

Whiteboard: [MemShrink] → [MemShrink:P3]

Hi Thomas,

Thanks for confirming this issue has been solved on your end.

Please feel free to reopen this bug if you encounter similar issues in the future.

Regards, Clara

Closed: 2 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.