DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Fri, 20 Jul 2007 00:00:51 -0700,    posted on: microsoft.public.dotnet.framework.compactframework        back       

Thread Index
  1    Rory McLeod noreply_AT_noreply_dot_com


Memory Leak using webservice   
We have created a webservice to download an array of data that is used 
to populate a local database for user logins.

When we call the procedure there is a consistent leak of 32 bytes (or 
more, though always a multiple of 32 bytes).

The leak occurs regardless of whether or not the client is connect to 
the network.

Has anyone encountered this behavior ?

-Rory McLeod

The client code is simple:

         private void LeakThread()
         {
             using (MyWebService ptService = new MyWebService ())
             {
                 ptService.Timeout = 5000;

                 System.GC.Collect();
                 System.GC.Collect();

                 UiUtil.appendToListBox(this.listBox1,
                     System.GC.GetTotalMemory(false).ToString());

                 _logger.Log(LogLevel.Important, _leakThread, "Start");

                 while (!_leakThread.Stopped)
                 {
                     Thread.Sleep(LEAK_INTERVAL);

                     User[] array = null;

                     try
                     {
                         array = ptService.FetchUsers();
                     }
                     catch (WebException we)
                     {
                         HandleWebException("FetchUsers", we);
                     }
                     catch (Exception e)
                     {
                         _logger.Log("FetchUsers", e);
                     }

                     System.GC.Collect();
                     System.GC.Collect();

                     UiUtil.appendToListBox(this.listBox1,
                         System.GC.GetTotalMemory(false).ToString());

                     _logger.Log(LogLevel.Important, _leakThread,
                         (array == null)
                         ? "NULL"
                         : "len=" + array.Length);

                 }
             }
             _logger.Log(LogLevel.Important, _leakThread, "Exit");

         }

 From reference.cs:

         public User[] FetchUsers() {
             object[] results = this.Invoke("FetchUsers", new object[0]);
             return ((User[])(results[0]));
         }


Sample output:

ms	mem	delta	notes
1	28152		# LogStart
5	95784		Important:Leak:Start
16	159720		Important:Leak:len=10
18	159752	32	Important:Leak:len=10
20	159784	32	Important:Leak:len=10
22	159816	32	Important:Leak:len=10
24	159864	48	Important:Leak:len=10
26	159896	32	Important:Leak:len=10
28	159928	32	Important:Leak:len=10
31	159960	32	Important:Leak:len=10
33	160024	64	Important:Leak:len=10
35	160056	32	Important:Leak:len=10
37	160088	32	Important:Leak:len=10
39	160120	32	Important:Leak:len=10
41	160152	32	Important:Leak:len=10
43	160184	32	Important:Leak:len=10
46	160216	32	Important:Leak:len=10
48	160248	32	Important:Leak:len=10
50	160344	96	Important:Leak:len=10
52	160376	32	Important:Leak:len=10
54	160408	32	Important:Leak:len=10
56	160440	32	Important:Leak:len=10
58	160472	32	Important:Leak:len=10
60	160504	32	Important:Leak:len=10
62	160536	32	Important:Leak:len=10
64	160568	32	Important:Leak:len=10
66	160600	32	Important:Leak:len=10
68	160632	32	Important:Leak:len=10
70	160664	32	Important:Leak:len=10
73	160696	32	Important:Leak:len=10
75	160728	32	Important:Leak:len=10
77	160760	32	Important:Leak:len=10
79	160792	32	Important:Leak:len=10
82	160824	32	Important:Leak:len=10
84	160984	160	Important:Leak:len=10
86	161016	32	Important:Leak:len=10
88	161048	32	Important:Leak:len=10
92	161080	32	Important:Leak:len=10
94	161112	32	Important:Leak:len=10
96	161144	32	Important:Leak:len=10
98	161176	32	Important:Leak:len=10
100	161212	36	Important:Leak:len=10
102	161244	32	Important:Leak:len=10
104	161276	32	Important:Leak:len=10
106	161308	32	Important:Leak:len=10
108	161340	32	Important:Leak:len=10
111	161360	20	Important:Leak:len=10
111	169868		Important:Leak:Exit
Date:Fri, 20 Jul 2007 00:00:51 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us