![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Huh? This make any sense to anyone? |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
I have a little more information. The difference appears to be related to System.Threading.Thread. If I build a standalone .Net service in .Net 2.0 that starts 100 threads, I will see ~110 MB of memory allocated in private bytes to this process. The same code on .Net 1.1 results in 7 MB of memory in private bytes. If anyone can explain this, I am very interested in understanding this. Thanks. Joe |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
My theory is that the .Net 2.0 behavior is correct too - I just can't explain what I see in .Net 1.1 Is it possible that .Net 1.1 used the Win32 thread pool in some way, resulting in the memory allocated for a threads to be counted as shared memory, and thus not being counted in private bytes? I used 100 as an example. Our thread pool shrinks/grows based on demand. Joe |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
Okay, then I can't explain it. Go ahead and try it though. The below code in .Net 1.1 reports 7MB for private bytes, but 111MB in 2.0. namespace TestService { public partial class Service1 : ServiceBase { public Service1() { InitializeComponent(); } protected override void OnStart(string[] args) { for (int i = 0; i < 100; i++) { Thread thread = new Thread(Service1.Run); thread.Start(); } } protected override void OnStop() { // TODO: Add code here to perform any tear-down necessary to stop your service. } protected static void Run() { while (true) { Thread.Sleep(1000*10); } } } } |
#10
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |