Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:34:39+00:00 2026-06-12T22:34:39+00:00

If I have a map containing the id s of DOM elements and I

  • 0

If I have a map containing the ids of DOM elements and I want to de-reference an entry in the map, so the corresponding element can be picked up by garbage collector, what are the steps I should go through to make sure there is no memory leak? Should I delete or = null on the map entry? What do I need to do about the element itself?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:34:40+00:00Added an answer on June 12, 2026 at 10:34 pm

    (I assume by “map” you mean “object”.)

    To permanently remove a property and value from an object, use delete. Using null will have the effect of clearing the value, but retaining the property.

    Both will allow the value to be garbage collected.

    But to what you’re trying to accomplish, if the map only has reference to an ID string, it will have no impact on the element itself. You need to drop all references to the element (in DOM and JavaScript) to ensure the element is garbage collected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to generate <map> and <area> elements on a web page containing many
In C++, I have a map<string, string> , containing an unknown number of entries.
I have a class containing a std::unique_ptr<> and I want to put instances of
I have made an application containing facility of viewing current location on map. I
I have a vector containing objects of type STL map, and I do vector.push_back(some
I have a file in C++ containing constant definitions, I want to use the
I have a Map containing Strings for keys and Lists as values. After putting
Possible Duplicate: Scala map containing mix type values I have a situation where in
I have a collsion map, and some places that I want to be light
I have a Haskell Map, containing strings as keys and some lambda functions as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.