Mastering Memory Management in Node.js: Tips and Tricks for Better Performance

  Рет қаралды 38,003

Software Developer Diaries

Software Developer Diaries

Күн бұрын

Пікірлер: 49
@uncleiroh3616
@uncleiroh3616 Жыл бұрын
This video is a gem for those who want to learn a new thing or for those who just started server side development
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
Always happy to share such videos! Let me know in case if you ever have ideas :)
@uncleiroh3616
@uncleiroh3616 Жыл бұрын
Do a video on threading, i think many of us would love to watch it.
@yogeshmahale8389
@yogeshmahale8389 5 ай бұрын
Awesome. I am looking for this video only...Now I am doing code review of junior developers very efficiently with this tips.
@mr.h_arab
@mr.h_arab 9 ай бұрын
most node ja useful video so far ❤️
@aliadel1723
@aliadel1723 26 күн бұрын
I'm In love with this channel
@NishantTomar-m2t
@NishantTomar-m2t Жыл бұрын
Great insight and simplicity on each topic you represent. This series of advance node.js is just great. Hopping for more great content in this series.
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
Thanks! More to come :)
@MAK_007
@MAK_007 2 ай бұрын
What an excellent video. Thank you. I am currently watching all of your videos
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries 2 ай бұрын
Happy to hear, mate!
@apurvwaghmare5974
@apurvwaghmare5974 Ай бұрын
@@SoftwareDeveloperDiaries hello currently i am working on a project of encryption and decryption where i have file format like txt, jpg, mo3 and mp4 but for mp4 it gives heap out of memory and memory leak will this help me in resolving the issue as i have deployed my project on render ?
@themixmaster
@themixmaster Жыл бұрын
That's a masterpiece bro, keep doing good stuff for us
@Nick-wz6tz
@Nick-wz6tz Жыл бұрын
Omg thank you so much ! Needed this a lot
@שחקדויטש
@שחקדויטש 5 ай бұрын
Great video, simple, clear and to the point :)
@judgebot7353
@judgebot7353 5 ай бұрын
just found your channel it's amazing man. Thanks a lot
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries 5 ай бұрын
Glad you enjoy it!
@sparshturkane2550
@sparshturkane2550 Ай бұрын
Nice explanation
@Joel-do3oi
@Joel-do3oi 5 ай бұрын
Thanks for the tips!
@dominggusoctovianus4915
@dominggusoctovianus4915 Жыл бұрын
Nice work Gusgadirov. Would you mind to share this topic again but on client side especially using React? I would love to watch it.
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
Great suggestion, I'll take a look into it!
@dominggusoctovianus4915
@dominggusoctovianus4915 Жыл бұрын
@@SoftwareDeveloperDiaries Awesome
@kvahh4290
@kvahh4290 Жыл бұрын
Thank you so much for this content, your teaching is excellent. Would you mind telling me what this blackboard app is?
@GameON-Playstation
@GameON-Playstation Жыл бұрын
it's called excalidraw
@TheDuckPox
@TheDuckPox Жыл бұрын
Why would you clear the timeout you just created? I think the example only presents bugs since the setTimeout callback might never even has a chance to fire.
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
Great point, I didn't realize that!
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
Here's what ChatGPT says about it :d f the callback of your setTimeout doesn't perform any asynchronous operations and finishes quickly, you might not necessarily need to clear the setTimeout. In this case, the callback function will execute and complete its tasks promptly, without causing any delays or issues. The main reason for clearing setTimeout is to prevent unnecessary execution of the callback when it's no longer needed or to avoid any potential side effects caused by executing the callback after the client has already received a response or disconnected. If the callback is lightweight, performs synchronous operations, and completes quickly, it's less likely to cause any adverse effects. However, you should still consider the following factors: Server resources: Even if the callback finishes quickly, it might still consume server resources unnecessarily. If you have many such timeouts running simultaneously and frequently, it could potentially impact the overall performance of your server. Expected behavior: Consider whether it makes sense for the callback to run after the request has already been completed. If the callback's actions are related to the request/response cycle, it's better to clear the timeout to ensure that it doesn't execute inappropriately. Code maintainability: While a fast synchronous callback may not cause immediate issues, it might become problematic as your codebase evolves. Clearing the setTimeout ensures that the behavior of your code remains predictable and avoids potential bugs if your code logic changes in the future. In conclusion, if the callback finishes quickly, it might not immediately cause noticeable issues, but it's still good practice to clear the setTimeout to ensure proper behavior and code maintainability in the long run. It also helps adhere to best practices and makes it easier for other developers to understand and maintain your code.
@Alfakatt
@Alfakatt Ай бұрын
Wait, did you just ask chatgpt for advanced topics and went down that path making these tutorials?
@pabloroque8268
@pabloroque8268 7 ай бұрын
Great video!
@yogiHalim
@yogiHalim 5 ай бұрын
wow Thank you
@maxhou8395
@maxhou8395 Жыл бұрын
Great video 🎉, very useful for me😊
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
Glad to hear! 🫶
@WIBEDRILLMusic
@WIBEDRILLMusic 9 ай бұрын
Can you please make a video on multi-tenancy in node js using any database like PostgresQL or MongoDB?
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries 9 ай бұрын
Will add this to my list 👌
@643_sankettiwari5
@643_sankettiwari5 8 ай бұрын
which tool he is using as the blackboard?
@KasthuriarachichigePrasanna
@KasthuriarachichigePrasanna 4 ай бұрын
great
@M0HCT3R
@M0HCT3R Жыл бұрын
Is clearTimeout actually needed in 9:48? The only role of clearTimeout is it to prevent setTimeout callback from to be called.
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
Yes and no. Clearing timers is a good practice, especially "setInterval"s. Although leaving a "setTimeout" won't really hurt as you said.
@ulietaight
@ulietaight Жыл бұрын
​@@SoftwareDeveloperDiariesis it a bad practice to use setInterval like cron job, i mean if i need to call function 1 time per day, and i wont clear interval, because i need it
@Lemmy4555
@Lemmy4555 Жыл бұрын
@@ulietaight it's not, is actually the most efficient way since it uses internal timers. However depending of the requirement of your application you may need to use an external service dedicated to this kind of things.
@sergeyplotnikov4303
@sergeyplotnikov4303 Жыл бұрын
Thank you!!!
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
It's a pleasure!
@EducationAllTheTime123
@EducationAllTheTime123 Ай бұрын
Brother, I had a Node.js project, then we changed the method of connecting to SQL, and all the SQL queries slowed down. Later, we reverted to the old method, but it couldn't reach the old speed again. What can be done? (Windows Server | Mssql | Node.js)
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Ай бұрын
Thanks for donating, my friend! That sounds strange, can you make sure that you are using connection pooling? If you are, but reverting to the old method caused a slowdown, then maybe it's caused by the database or the machine, rather than the code? It could just be a coincidence that the slowdown happened during the code change.
@Tiberiumgod
@Tiberiumgod 2 ай бұрын
Do we really need to clear timeout even if it is executed? I thought that we need it only to cancel timeout.
@amirghorbanian1300
@amirghorbanian1300 2 ай бұрын
@akashchauhan1116
@akashchauhan1116 9 ай бұрын
"just to make sure My computed doesn't explode ...." 😂
@ikronos4951
@ikronos4951 Жыл бұрын
“Always clear your timeouts” 😂 Didn’t you mean Intervals?
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
Both should be cleared 😛
How to handle Node.js errors like a Pro?
12:44
Software Developer Diaries
Рет қаралды 34 М.
JavaScript Memory Leaks and How To Fix Them
14:58
Software Developer Diaries
Рет қаралды 29 М.
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 12 МЛН
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 17 МЛН
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 5 МЛН
Finally Fix Your Issues With JS/React Memory Management 😤
20:13
Jack Herrington
Рет қаралды 88 М.
How to make your Node.js API 5x faster!
16:39
Adventures in Nodeland - Matteo Collina
Рет қаралды 11 М.
Scaling your Node.js app using the "cluster" module
13:44
Software Developer Diaries
Рет қаралды 48 М.
Concurrency vs Parallelism in Node.js
7:47
Mehul - Codedamn
Рет қаралды 44 М.
Node.js Doesn’t Suck Anymore
16:59
Web Dev Simplified
Рет қаралды 128 М.
Hardest Backend Node.js Concept to Master
11:20
Mehul - Codedamn
Рет қаралды 69 М.
How I Made JavaScript BLAZINGLY FAST
10:10
ThePrimeagen
Рет қаралды 222 М.
Only The Best Developers Understand How This Works
18:32
Web Dev Simplified
Рет қаралды 113 М.
Node.js is a serious thing now… (2023)
8:18
Code With Ryan
Рет қаралды 659 М.
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 12 МЛН