Hey all.

I am trying to trouble shoot a memory leak using .NET CF2 SP2. I am using
the Remote Performance Monitor from 3.5 PowerToys.

Usually I have great success with this tool in tracking down memory leaks
but in this instance I am confused.

We spawn a bunch of threads, they do something, control.Invoke to update
some UI then exit. Loop through doing this a ton of times (we are stress
testing the leak).

This blog almost describes what I am experiencing on CF2:
http://skalyan.blogspot.com/2008/06/thread-local-storage-leak-in-compact.html

However we are not doing SetData or GetData at all on any thread.

In performance monitor we are seeing the following:

System.Object[] Size: 268 Bytes, ID, ......someid.....)
---> [root: Other] System.LocalDataStore (Size: 16Bytes, ID, ....someid....)
---------> System.Object[] (Size: 140 Bytes, ID, ...someid...)
---------------> System.Collections.ArrayList (Size: 24 Bytes, ID,
...someid...)
--------------------> [root: Static (System.Threading.Thread)]
System.LocalDataStoreMgr (Size 24 Bytes, ID, ...someid...)

We see a ton of these. As we loop creating threads, we just see this number
sky rocket.

I tried to reproduce a simple test case of spawning threads, calling
control.invoke in the thread etc and do not see the leak.

Upgrading to 3.5 as the blog says is not an option for us.

Can anyone think of something that can be creating these leaks without the
SetData/GetData being called since we are not doing so?

In the Remote Profiler tree list, I cannot see any of the nodes attached to
these items attached to anything in our code so I'm not sure why their
lingering.

Any help would be greatly appreciated!

Thanks so much for your time in advance.

The threads are not leaking

I am getting the following objects showing up in