[Mono-bugs] [Bug 359561] New: Gtk does a lot of boxing because it uses .NET 1.1 code

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 7 08:53:36 EST 2008


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


           Summary: Gtk does a lot of boxing because it uses .NET 1.1 code
           Product: gtk#
           Version: unspecified
          Platform: i686
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: gtk-sharp
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: anders at iola.dk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


While profiling Nemo, which uses Gtk, I saw the following:

Allocation profiler
Total mem Method
########################
   49536 KB GLib.SourceProxy::Remove()
       49433 KB  4218320 System.UInt32                                   
          57 KB     2944 System.Collections.ArrayList                    
  Callers (with count) that contribute at least for 1%:
        2944  100 % .TimeoutProxy::Handler()
########################

The top memory user is the GLib bindings, the snapshot is taken right after
starting up. Looking into the issue it appears that the
GLib.SourceProxy::Remove() function uses ArrayList for storing temporary values
and thus does boxing of the 4 million uints.

So I made trivial changes (attached) to Remove(), recompiled, and tada, 50mb
less allocated memory. 

########################
      59 KB GLib.SourceProxy::Remove()
          59 KB     3069 System.Collections.Generic.List`1               
  Callers (with count) that contribute at least for 1%:
        3069  100 % .TimeoutProxy::Handler()

I'm not familiar with how the GTK bindings work in detail, I guess a lot of the
code is generated by some tool? The change is only to one place in the code and
I'm sure there are lot of other places that could use the same treatment if the
bindings was converted to .NET 2.0 (gmcs).

So is there any reason why the GTK bindings still uses mcs?


-- 
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