Bug 928967 - The extended view resources tab leaks memory.
Summary: The extended view resources tab leaks memory.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-userportal
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 3.3.0
Assignee: Alexander Wels
QA Contact: Jiri Belka
URL:
Whiteboard: ux
Depends On: 913142
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-28 20:43 UTC by Einav Cohen
Modified: 2016-01-28 21:57 UTC (History)
11 users (show)

Fixed In Version: sf14
Doc Type: Bug Fix
Doc Text:
Clone Of: 913142
Environment:
Last Closed:
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 13349 0 None None None Never
oVirt gerrit 14062 0 None None None Never

Description Einav Cohen 2013-03-28 20:43:42 UTC
+++ This bug was initially created as a clone of Bug #913142 +++

Description of problem:
Memory usage of the browser tab containing the user portal increases until the browser has exhausted the available memory.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Log into the user portal with an admin level user.
2. Switch to the extended tab, then click the 'resources' tab on the left.
3. You will get to the resources screen which contains a tree table with information about the VMs. You will also notice a refresh timer. Set the timer to 5 seconds.
4. Open up an application that can monitor memory usage of the browser. For instance the task manager in windows.
5. Wait and watch the memory usage of the browser grow and grow.
  
Actual results:
Memory increases until available memory is exhausted.

Expected results:
Memory increases until unused objects are garbage collected and memory usage drops again.

Additional info:

--- Additional comment from ofri on 2013-02-24 06:23:54 EST ---

Unable to reproduce on Firefox 18. Please provide more details (browser + version, OS)

Thanks

--- Additional comment from Alexander Wels on 2013-02-25 08:43:21 EST ---

Well it is hard to identify memory leaks in FF. Try in either Chrome or IE8. Instructions for IE8:

Open up your IE8, and open up the task manager. Browse to the extended tab resources tab. Note the memory usage by the iexplorer process. Hit refresh a few times or just wait for the refresh timer to fire a couple of times. You will notice the memory usage of iexplorer will increase each time you hit refresh.

Instructions for Chrome:

I highly suggest you compile GWT in detailed mode as the Chrome memory profiler will provide you with information on which objects are leaking. Open up Chrome, log into the user portal, switch to the extended tab, select the resources tab. Press CTRL-SHIFT-I. This will open up the Chrome developer tools. Click on the 'Profiles' button. In the profiles tab, click the 'Take Heap Snapshot' selection box. Then click start. This will take a memory snapshot. Go back to the browser, and hit refresh a couple of time or let the timer refresh for a while. 

Go back to the developer tools and take another snapshot. You will notice that the second snapshot uses more memory (this doesn't mean a leak as some stuff might not have been garbage collected). On the second snapshot, at the bottom of the window you can click and change the summary/overview to comparison. It should automatically select the other snapshot. 

The window will now display all the objects in memory and the deltas. You should see a bunch of objects with +<number> which means there are more of those in the second snapshot than there were in the first one. If you compiled in detailed mode you should get some indication of what objects those are and were to start looking for the leak.

--- Additional comment from ofri on 2013-02-26 04:39:27 EST ---

Thanks for the detailed instructions.

I have found a memory leakage of about 5MB per hour. Alexander, Does this numbers match your findings?

On the general, I run the same process over Basic View and VM tab as well. they all seem to produce the same results.

Resources tab  +959,264 B  
Basic View     +1,103,312 B
Vm tab         +673,672 B

*for 10 minutes

--- Additional comment from Alexander Wels on 2013-02-26 08:36:47 EST ---

Well the memory leak depends on the number of VMs and how you compile the software (in detailed mode it leaks more memory than obfuscated mode). We were seeing much higher leakage. In the 20-40M per refresh. In general what we saw was one or both of the following issues:

1. Event handlers being attached to UserPortalItemModel or UserPortalItemListModel, without being removed when new data arrived. Those are usually slower leaks.
2. Circular references to entities and UserPortalItemModel or UserPortalItemListModel. Which would cause the entire entity and associated views to not be garbage collected when new data arrives. These are usually faster leaks, in the tens of megabytes per refresh.

We have found and fixed most of those memory leaks in some other patches that are about to make it into the master. The only one we found but didn't fix is the one on the resources tab. I put in this bugzilla so we wouldn't forget to actually fix the memory leak.

Comment 2 Jiri Belka 2013-05-03 12:51:21 UTC
oK, sf15, looks ok, not big increase seen.

Comment 3 Itamar Heim 2014-01-21 22:24:40 UTC
Closing - RHEV 3.3 Released

Comment 4 Itamar Heim 2014-01-21 22:25:30 UTC
Closing - RHEV 3.3 Released

Comment 5 Itamar Heim 2014-01-21 22:29:03 UTC
Closing - RHEV 3.3 Released


Note You need to log in before you can comment on or make changes to this bug.