0

I am debugging memory-issues in an angular app, and have this memory snapshot in Firefox

enter image description here

I have then tried deleting all the images using this in the console

document.querySelector("img").remove();

(I ran that multiple times until it failed bacause all images were deleted. All visible images disappered from view)

However the memory snapshot still shows the same amount of memory used for IMG.

Is there some virtual DOM that I missed since the memory is not freed?

Is it just something that will be Garbage-Collected later?

What other methods exist to identify the elements taking up memory?

5
  • 1
    "Is it just something that will be Garbage-Collected later?" - Yes Commented Dec 8, 2021 at 12:48
  • Ok, so it is part not part of the DOM as such, but the memory was there at some point (I am new to that part of the developer console) Commented Dec 8, 2021 at 12:59
  • The Objects are not part of the DOM anymore, but they still exist in the computer RAM until the garbage collector does its work (IF they are not stored in some other variable of course). Commented Dec 8, 2021 at 13:07
  • Is there a way to force a GC run to see what the state of the IMG elements are? Commented Dec 8, 2021 at 13:12
  • 1
    None that I know of... But apparently there is a way in IE and Opera, see stackoverflow.com/questions/8032928/… Commented Dec 8, 2021 at 13:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.