Electron not letting go of memory


#1

Is there a way to allow electron to let go of the memory that it uses when navigating from page to page? Every time I navigate from one page to another, my memory consumption for the electron.exe process goes up about 8mb and it never goes down. So if I use the app for a long time, it eventually consumes so much memory that it crashes completely.


#2

Perhaps related to:

The answer was to use Session.clearCache(callback):


#3

My app really doesn’t have any images that it displays… But I will try that fix nonetheless.


#4

Since my app isn’t locally hosted (I basically point electron to a URL) I’m not exactly sure how I would implement this on my main.js script. Is there a way to listen for a url change even if your app is pointing to an outside server? I’ve tried the open-url event with no luck.


#5

Your app use webview or write direct HTML?


#6
mainWindow.loadUrl('http://webserver.com');

Is what I’m using. I also want to note that my page uses an outer frame and then an iframe that I load my other pages into. When I navigate from page to page, it’s the iframe that loads the new page. From my research, I’ve found there seems to be memory issues in chromium when using iframes.

  1. https://code.google.com/p/chromium/issues/detail?id=359401
  2. https://code.google.com/p/chromium/issues/detail?id=64748