Page reload leaks memory

Bug #1552796 reported by David
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Midori Web Browser
Confirmed
Undecided
Unassigned

Bug Description

When window.location.reload() is invoked a small amount memory is leaked. Over time, if continually invoked, memory usage will gradually climb and if left unattended altogether shall grow until the OS kills the process automatically. This is a particular problem in kiosk applications where an instance is expected to run unattended for a long period of time. I can reproduce this problem both on the x86_64 build and the arm Raspberry Pi version, either installed from repositories or compiled from source.

Side-by-side comparison with Firefox and Chrome show their memory footprints growing but then released.

Details from the desktop version:

Command line midori refresh2.html
Midori 0.5.11 ((null)) Midori
GTK+ 2.24.23 (2.24.23) Glib 2.40.2 (2.42.2)
WebKitGTK+ 2.4.8 (2.4.8) libSoup 2.44.2
cairo 1.13.1 (1.14.2) libnotify No
gcr 3.10.1 granite No
Platform X11; Linux x86_64
Identification Mozilla/5.0 (X11; Linux) AppleWebKit/538.15 (KHTML, like Gecko) Chrome/18.0.1025.133 Safari/538.15 Midori/0.5
Video Formats H264 [x] Ogg Theora [x] WebM [x]

To verify:

1) Run the below HTML/JS in midori, Firefox and Chrome.
2) Monitor memory usage via 'top' application.
3) Allow to run for a lengthy period (e.g., at least an hour) for the leak to become pronounced.

Test HTML/JS page to reproduce the problem:

<!DOCTYPE html>
<head>
 <title>Midori refresh test</title>
 <script type="text/javascript">
  setTimeout(function() { window.location.reload(); }, 3000);
 </script>
</head>
<body>

</body>

Tags: leak
Revision history for this message
gue5t gue5t (gue5t) wrote :

Hi, can you determine whether this still occurs when running Midori with "midori --plain"? This tests the WebKit rendering engine alone, so we can tell whether this is caused by code in Midori itself having leaks, or if WebKit is leaky (or both).

Changed in midori:
status: New → Incomplete
Revision history for this message
David (davidanthonygrubb) wrote :

Thanks for the reply. Yes, it stays stable when the --plain option is used.

Revision history for this message
gue5t gue5t (gue5t) wrote :

That places the blame squarely on Midori. Oh well.

I know of a few leaks (and have a private branch where I've been working to fix some of them) but it might be nice to know exactly which are triggered simply by reloading. If it isn't too much trouble, it'd be great if you could run under valgrind and get some info on where leaks come from. I can do that while trying to fix this, but I don't know when I'll have a chance, and it would make my life easier to go into fixing directly rather than having to profile it myself and then fix.

Changed in midori:
status: Incomplete → Confirmed
tags: added: leak
Revision history for this message
David (davidanthonygrubb) wrote :

"If it isn't too much trouble, it'd be great if you could run under valgrind and get some info on where leaks come from."

Sure, that won't be a problem.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.