[Mono-bugs] [Bug 345430] New: Mono.Data.Sqlite uses 5 MB heap b/c of reflection

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Dec 1 14:54:04 EST 2007


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

           Summary: Mono.Data.Sqlite uses 5 MB heap b/c of reflection
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Mono.Data.Sqlite
        AssignedTo: mhabersack at novell.com
        ReportedBy: gburt at novell.com
         QAContact: mono-bugs at ximian.com
          Found By: ---


I tried replacing Mono.Data.SqliteClient with Mono.Data.Sqlite in Banshee, and
it functioned fine, but I noticed it adversely affected Banshee's memory usage:

25.1M writable w/o it (20M heap)  and 34.6M writable w/ it (25M heap)

Using heap-buddy, it looks like most of the new memory usage comes from

mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteFunction.cs

and in particular the static constructor, that has this comment:

/// Using reflection, enumerate all assemblies in the current appdomain looking
for classes that
/// have a SqliteFunctionAttribute attribute, and registering them accordingly.

Since Types are not GC'd, this is a major memory leak.

If there is a definite need to dynamically/automatically load all the
SqliteFunctions on startup, another way needs to be found (see the work done on
Banshee/Beagle regarding plugins and this issue).  If not, I would suggest this
static ctor is simply removed.

Possibly another bug (I don't know the internal timing details of how
assemblies are loaded and static ctors called) - is it possible to not
automatically load some SqliteFunctions b/c they are in assemblies loaded after
Mono.Data.Sqlite?


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


More information about the mono-bugs mailing list