Search code examples
pythonmemoryraspberry-piraspbian

Luakit memory consuming


I made simple python script that is wrapper for Luakit, can enter and show some websites. Everything works fine, but after a while I noticed that Luakit is "eating" RAM memory more and more as long as it is open and showing some web site. At the end Luakit will crash and "eat" almost all available memory. Here is simple picture that is showing logs with memory and CPU usage

enter image description here

Python script is running from my Raspberry Pi 3 (newest Raspbian update), approximate time for crashing depends what you are showing in Luakit, some websites like youtube eat more memory. In this picture I tested with youtube website, ran almost 6 hours before crashing.

I am running luakit with help of pExpect and xdotool modules. Pexpect to run child apps in my python script and xdotool to simulate keyboard input to manipulate with browser eg. r key for refreshing web page, etc...

My question is, why Luakit consumes RAM memory more and more as time goes on, and is there any way to fix this, except restarting Luakit ?


Solution

  • It was because of some user scripts were leaking memory. You can comment it out in rc.lua file if you don't really need them (cookies.db, session.db, bookmarks, etc.), and generally all of them that you don't need.