[Mono-bugs] [Bug 467418] New: ListView in VirtualMode uses too much memory and is slow

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jan 19 13:33:06 EST 2009


https://bugzilla.novell.com/show_bug.cgi?id=467418


           Summary: ListView in VirtualMode uses too much memory and is
                    slow
    Classification: Mono
           Product: Mono: Class Libraries
           Version: unspecified
          Platform: x86-64
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mono at esar.org.uk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=266059)
 --> (https://bugzilla.novell.com/attachment.cgi?id=266059)
test app

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.5)
Gecko/2008121623 Ubuntu/8.10 (intrepid) Firefox/3.0.5

When the list view is in virtual mode it still allocates space internally in
the items_location, items_matrix_location and item_index_matrix arrays for each
virtual item. As a result the list view uses almost as much memory in virtual
mode as it does when the items are added to the ListView.Items collection.

In addition, whenever the VirtualListSize property is changed the list view
requests all list items one by one to add them to the above arrays. As a
result, if the application is adding items to the list on the fly then the list
will ask for all the items over and over again.

Also the FirstVisibleItem property which is used while drawing does a linear
scan of the items, which with a huge number of items takes a very long time.



Reproducible: Always

Steps to Reproduce:
1. Add a ListView to a form
2. Set VirtualMode to true
3. Implement RetrieveVirtualItems
4. Set VirtualListSize to 1000000
5. Attempt to navigate the list, especially in LargeIcon view
Actual Results:  
The application stops responding, actually in LargeIcon view my whole ubuntu
desktop stops responding.

Expected Results:  
Should be able to navigate and switch views without any problems.

I've attached a test application that demonstrates the problem. Compile with:
gmcs /r:System.Windows.Forms.dll /r:System.Drawing virtlist.cs

I've created a patch which fixes the problems, which I will attach.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list