Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
Observer API memory usage

there is an example on the MDN document.

function createObserver() {
  let observer;

  let options = {
    root: null,
    rootMargin: "0px",
    threshold: buildThresholdList()
  };

  observer = new IntersectionObserver(handleIntersect, options);
  observer.observe(boxElement);
}

I am wondering when is the observer object would be free by the GC.

Because there is no variable access to observer after function is end.But this example still functional.

Can memory usage be seem in chrome dev-tool ?

Thank for any help !!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can see chrome memory usage in the "memory" tab...

As for when it is GC. It will be collected only once it is destroyed. It is because the callback could have side-effects.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!