---
title: "Comment by sandeep negi on \"Garbage Collection is slowing down your code\" | Hashnode"
description: "thanks for sharing man , but most of the time garbage collection is pretty fast in Java and usually i make sure create object and variables in a scope so that o"
url: "https://hashnode.com/posts/garbage-collection-is-slowing-down-your-code/635427b26f1409587a2a4725/comment/6354330ab29017d65cd63822"
---

[Discussion](https://hashnode.com/posts/garbage-collection-is-slowing-down-your-code/635427b26f1409587a2a4725)

Comment [Garbage Collection is slowing down your code](https://hashnode.com/posts/garbage-collection-is-slowing-down-your-code/635427b26f1409587a2a4725)

[sandeep negi](https://hashnode.com/@sandeepnegi1996)

[Oct 22, 2022](https://hashnode.com/posts/garbage-collection-is-slowing-down-your-code/635427b26f1409587a2a4725/comment/6354330ab29017d65cd63822)

thanks for sharing man , but most of the time garbage collection is pretty fast in Java and usually i make sure create object and variables in a scope so that once they become out of scope it will be available for garbage collection need to try the source code shared by you , and love the intro bro ;)

[Vishal Arora](https://hashnode.com/@wishall)

[Oct 22, 2022](https://hashnode.com/posts/garbage-collection-is-slowing-down-your-code/635427b26f1409587a2a4725/comment/6354330ab29017d65cd63822#reply-635438a0b29017d65cd638d1)

it depends on the programming language as well as the size of the source code. Java's garbage collection is faster as compared to others. But I would suggest instead of making the objects and variables available for garbage collection, use a centralized pool and release this variable into that pool, so that other parts of the program can re-use the memory. If you want to see how much time is being taken by the garbage collector in your program, you can use the profiling tab to check in the Chrome's developer tools.
