A
awaken77
My app calling async web service in a loop, cancelling the request via
handle.Abort() if timeout is expired.
I started continious test in environment where WebService always fails
(call to WS never returned to client and always cause to Abort() )
After 18000 polling cycles, overall memory consumption increased from
15,13Mb to 15,59Mb. During some little period of time it seems to be
constant, but is slowly grows.
Is it a leak related to async WS call mechanism?
Application also does some work with MSSQL CE but I call Dispose() for
Command object after each usage for sure.
I do not create and destroy forms many times (there is only one form
with controls, created at startup), so I don't see other possible
sources for leaking.
I have some opinion why does it work this way. WebService proxy using
internally a thread in BeginXXX method. This thread creates HTTP
connection via underlying socket API (unmanaged). When unmanaged call
is invoked, resources allocated in this thread are "pinned" by GC to
particular memory block. So this block never released before thread
runs to completion.
Each new polling cycle, pending async request object is not destroyed,
but new one created. So these hidden threads grow in number, as I poll
web service with low interval (once per second), but thread can hang on
connection for a long timeout.
Am I right?
p.s. my environment:
..NET CF SP3
Windows Mobile 2003 SE
ARM emulator (from VS2005), or Axim X30
handle.Abort() if timeout is expired.
I started continious test in environment where WebService always fails
(call to WS never returned to client and always cause to Abort() )
After 18000 polling cycles, overall memory consumption increased from
15,13Mb to 15,59Mb. During some little period of time it seems to be
constant, but is slowly grows.
Is it a leak related to async WS call mechanism?
Application also does some work with MSSQL CE but I call Dispose() for
Command object after each usage for sure.
I do not create and destroy forms many times (there is only one form
with controls, created at startup), so I don't see other possible
sources for leaking.
I have some opinion why does it work this way. WebService proxy using
internally a thread in BeginXXX method. This thread creates HTTP
connection via underlying socket API (unmanaged). When unmanaged call
is invoked, resources allocated in this thread are "pinned" by GC to
particular memory block. So this block never released before thread
runs to completion.
Each new polling cycle, pending async request object is not destroyed,
but new one created. So these hidden threads grow in number, as I poll
web service with low interval (once per second), but thread can hang on
connection for a long timeout.
Am I right?
p.s. my environment:
..NET CF SP3
Windows Mobile 2003 SE
ARM emulator (from VS2005), or Axim X30