Bug 39940 - Unmanaged memory leaks detected by valgrind
Summary: Unmanaged memory leaks detected by valgrind
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: 4.2.0 (C6)
Hardware: All Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-03-28 07:31 UTC by Matt Z
Modified: 2016-04-25 22:27 UTC (History)
2 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:

Valgrind memcheck output (5.79 MB, text/plain)
2016-03-28 07:31 UTC, Matt Z

Description Matt Z 2016-03-28 07:31:47 UTC
Created attachment 15534 [details]
Valgrind memcheck output

We are experience major unmanaged memory leaks (3 GB in 10 hours) for our Linux backend service running on Mono 4.2.2. The managed heap stays consistent around 50 MB. I am using valgrind to find the source(s), but it reported so many leaks that I'm not sure which are real and which are false positives.

Zoltan Varga provided a fix for one of the leaks I mentioned on the mono-devel mailing list (http://lists.ximian.com/pipermail/mono-devel-list/2016-March/043575.html), but after applying it, over 19,000 instances of leaked memory are still reported after just starting up our app and letting it sit idle for a couple minutes.

I've attached the latest valgrind output file.
Comment 1 Matt Z 2016-04-25 22:27:49 UTC
Most of these valgrind issues have now been resolved in Mono 4.4, and so this issue can be closed. This turned out to only accounted for a small amount of our service's overall memory leak.

The actual issue that is causing us to grow so large so quickly looks to be a Mono bug in not GC'ing DynamicMethods fully and a new issue has been submitted: https://bugzilla.xamarin.com/show_bug.cgi?id=40691

Note You need to log in before you can comment on or make changes to this bug.