[Mono-bugs] [Bug 362147] New: InotifyWatcher is using too much memory

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Feb 15 08:09:19 EST 2008


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


           Summary: InotifyWatcher is using too much memory
           Product: Mono: Class Libraries
           Version: 1.2.6
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: anders at iola.dk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=195130)
 --> (https://bugzilla.novell.com/attachment.cgi?id=195130)
patch

I have a homedir with about 33000 folders. When I watch the homedir including
all subdirs I can see that inotify uses up about 9mb ram.

So I looked into the issue and it appears that the implementation is storing a
lot of stuff several times. There is no notion of a parent which would be where
one would store all the duplicated information. Instead each inotifydata
instance (a watched dir) must store all the information needed. This isn't
needed since the interface only allows one to operate on parents.

Attached is a patch that fixes the issue, besides the mentioned memory lowering
the performance has also been improved since it doesn't have to do a lot of
needless work.

Before we had something like:

Time(ms) Count   P/call(ms) Method name
########################
577482.124   33824   17.073  
System.IO.InotifyWatcher::StartMonitoringDirectory(InotifyData,bool)

Now:

Time(ms) Count   P/call(ms) Method name
########################
 295474.133   33824    8.736  
System.IO.InotifyWatcher::StartMonitoringDirectory(InotifyData,bool)

With the patch the overhead of inotify is ~600kb instead of 9mb ram.


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