{"comment":{"created_at":"2011-10-21T19:59:21Z","body":"To fix the issue, I had to add GC.Collect() to the end of the handler.  This isn't a good fix, but at least it gets me past the problem for now.","updated_at":"2011-10-21T19:59:21Z","url":"https://api.github.com/repos/MassTransit/MassTransit/issues/comments/2485581","id":2485581,"user":{"gravatar_id":"dccd5429cabca3453739561132a84c3a","avatar_url":"https://secure.gravatar.com/avatar/dccd5429cabca3453739561132a84c3a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jasondduncan","id":1136327,"login":"jasondduncan"}},"action":"created","issue":{"number":44,"created_at":"2011-10-18T17:43:30Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"We have a process that was created with the .8 version, and we are \r\nhaving major memory leak issues.  I tried to upgrade to 2.0, but the \r\ndifferences in versions are breaking changes for us. \r\n\r\n\r\nI have tried to do a test of the 2.0 version to see if it fixes the \r\nproblem, and it appears that every time messages are added/processed, \r\nthe memory just keep going up, and not releasing.  Here is my simple \r\nexample.  I have even tried using an instance instead of the \r\nsingleton. \r\n\r\n\r\n        [STAThread] \r\n        public static void Main(string[] args) \r\n        { \r\n            Bus.Initialize(sbc => \r\n            { \r\n                sbc.UseMsmq(); \r\n                sbc.VerifyMsmqConfiguration(); \r\n                //sbc.UseMulticastSubscriptionClient(); \r\n                sbc.ReceiveFrom(\"msmq://localhost/sendalert\"); \r\n                sbc.Subscribe(subs => \r\n                { \r\n                    subs.Handler<SendAlertCommand>(msg => \r\n                        { \r\n                            Console.WriteLine(\"Alert\"); \r\n                            msg = null; \r\n                        }); \r\n                }); \r\n\r\n\r\n            }); \r\n\r\n\r\n            _StartupSendAlert(); \r\n            Console.Read(); \r\n        } \r\n        private static void _StartupSendAlert() \r\n        { \r\n\r\n\r\n            var headers = new Headers(); \r\n            headers.Items = new List<Header> { \r\n                        new Header { Key= \"VendorNumber\", Value = \r\n\"044822\"}, \r\n                        new Header { Key= \"HO\", Value = \"1\"}, \r\n                    }; \r\n            for (int i = 0; i < 10000; i++) \r\n            { \r\n                AddMessage(headers); \r\n            } \r\n        } \r\n\r\n        public static void AddMessage(Headers headers) \r\n        { \r\n            Bus.Instance.Publish(new SendAlertCommand { EmailBody = \r\n\"Test\", Headers = headers }); \r\n        } \r\n\r\nI have the project zipped to help with the problem.","comments":1,"title":"Memory leak issues","updated_at":"2011-10-21T19:59:21Z","url":"https://api.github.com/repos/MassTransit/MassTransit/issues/44","id":1959373,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"dccd5429cabca3453739561132a84c3a","avatar_url":"https://secure.gravatar.com/avatar/dccd5429cabca3453739561132a84c3a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jasondduncan","id":1136327,"login":"jasondduncan"},"html_url":"https://github.com/MassTransit/MassTransit/issues/44","labels":[],"state":"open"},"legacy":{"issue_id":1959373,"comment_id":2485581}}