Any tips for reducing high memory usage?


#1

Hi, i’m very beginner of Electron.
Currently, it seems that electron consumes much memory.
Are there any tips for reducing it?


#2

All depends how you are coding. But, remember that the v8 engine it use a garbage collector. And for what I’ve read and learned…and saw lol. When you memory is more than 10 mb, the garbage collector start setting free the space in memory that is no longer needed. By aware of how you are coding, I mean, how set some variables, if you are using recursive, mmm some timing like setInterval vs setTimeout, and so on.
I remembered that I was using the new API Animation. So, I was using a simple transitions like mmm those carousel for news and this task up me processor to 35% till the end of the animation…as a new technology - I was new also trying this api - i decided don’t use it for now, because maybe was me code or it is the api…but I was killing my processor (well…not actually because I have 5 cores). Anyway. Try to learn how to use the tools that chromium gives you into the inspecter element, there you can see what is taking a lot of memory.