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

  • Home
  • SEARCH
  • 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 4086958
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:47:40+00:00 2026-05-20T18:47:40+00:00

I have learnt from this thread garbage collection with node.js that node.js uses a

  • 0

I have learnt from this thread garbage collection with node.js that node.js uses a generational GC.

I routinely use cyclic object references (both of which I delete/ensure go out of scope eventually) and would like to know if node.js handles them well. So for eg. if it was done using ref. counting, there would be a problem, so I would like to know how good node is at this.

Some usage scenarios:

  1. For every http request, I create a setTimeout with a lambda which potentially has references to scope objects. The scope object also has a reference to the timeout object, etc…

  2. For every user session, I have a pointer (still doing C programming) reference to the http request objects which also have references to the session object, etc… The request objects are deleted often, but the session object is not.

Edit: I ask because of this link that I found online http://lifecs.likai.org/2010/02/how-generational-garbage-collector.html

  • 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-05-20T18:47:40+00:00Added an answer on May 20, 2026 at 6:47 pm

    As you mentioned, NodeJS uses a generational GC… specifically v8. And therefore, it does NOT do reference counting type GC. Instead, it does a full mark-and-sweep type GC.

    So as long as you get rid of all references to a set of objects (even if they cyclic-ly point to one another), they should get garbage collected at some point.

    That doesn’t mean you shouldn’t care about the GC. If you have a very active NodeJS server, the garbage collector will be working really hard to cleanup your garbage, especially if you have lots of “medium-life-span” objects (i.e. not short or long lived).

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

Sidebar

Related Questions

I have this POSIX thread: void subthread(void) { while(!quit_thread) { // do something ...
I have just learnt that in C language malloc function comes with the issue
So I have a little app I am working on that scrapes comics from
Coming from a VB background and being forced to learn C# I have hit
I have learnt the factory method design pattern, and at the same time, I
The first language I learnt was PHP, but I have more recently picked up
I've recently decided that I just have to finally learn C/C++, and there is
I was just reading this thread and wondered if it's easier to become a
I have a multithreaded application. Each module is executed in a separate thread. Modules
Couldn't find anything about this topic. I have a Windows TCP C++ server application

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.