[Mono-bugs] [Bug 329684] New: Heavy memory usage in mono

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Sep 30 14:49:57 EDT 2007


           Summary: Heavy memory usage in mono
           Product: Mono: Runtime
           Version: 1.2
          Platform: i686
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: GC
        AssignedTo: lupus at novell.com
        ReportedBy: flipper98 at gmx.net
         QAContact: mono-bugs at ximian.com
          Found By: Customer

Running the following testcase in mono increases mem usage to 40meg
(and steeply rising) easily within seconds.
Running the testcase in mono < 1.2.5 hardly uses more than 10 megs and mem
usage also goes down a little sometimes.
Mem usage was determined using gnome systemmoninotor.
Replacing DirectoryInfo/FileInfo by
Directory.GetDirectories()/Directory.GetFiles() doesn't change much. 

What's also strange is that heap-shot only reports less than 5 megs of heap

Maybe something related to recursion?


using System;
using System.IO;

namespace MemTest
        class MainClass
        private static int counter;
                public static void Main(string[] args)
            RecursiveDump(new DirectoryInfo("/"));


        private static void RecursiveDump(DirectoryInfo d) {
            string s;
            FileInfo[] f = d.GetFiles();
            for (int i = 0; i < f.Length; i++) {
                try {
//                    s = f[i].FullName;
                } catch {}

            DirectoryInfo[] di = d.GetDirectories();
            for (int i = 0; i < di.Length; i++) {
                try {
                   if (counter == 500) {
//                       Console.WriteLine(di[i].FullName);
                        counter = 0;

                } catch {}


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