![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
John, Do you have verification that each object actually finishes up properly upon completion of its task? -Anatoly "Stingray" <nospam> wrote I'm having problems with a Queued Component I wrote in C#. While running it keeps sucking up memory. Eventually it (DLLHOST.exe) gets to around 440MB and the server comes to a crawl. I've been desperately trying to figure out what's wrong with my code for several weeks. In trying to figure this out I started with the sample provided with the Framework SDK and figured I'd keep modifying it to act more like my component until it broke. Without any modification, it does exactly the same thing. Each invocation increases the amount of memory used by DLLHOST. The memory doesn't get freed until I shut down the queue app. Has anyone else experienced this? Is there an interop problem maybe? Or a setting I forgot to make? Any help will be appreciated. Thanks. John |
#2
| |||
| |||
|
|
You said you started with an SDK sample. Specifically what sample was it. Also please provide some platform information regarding which platform(s) you are running on. Thanks, Mike "Stingray" <nospam> wrote in message news:OaWJtiVUDHA.1572 (AT) TK2MSFTNGP12 (DOT) phx.gbl... No. When this happens, the server comes to a crawl. I can't attach a debugger or do anything useful except shut down the COM+ app (even that takes a few minutes to respond to the clicks). So I don't really know what's going on. John "Anatoly" <wiretransfers (AT) yahoo (DOT) com> wrote in message news:69b80dd6.0307230718.15d2260a (AT) posting (DOT) google.com... John, Do you have verification that each object actually finishes up properly upon completion of its task? -Anatoly "Stingray" <nospam> wrote in message news:<euaL$QzTDHA.1576 (AT) TK2MSFTNGP12 (DOT) phx.gbl>... I'm having problems with a Queued Component I wrote in C#. While running it keeps sucking up memory. Eventually it (DLLHOST.exe) gets to around 440MB and the server comes to a crawl. I've been desperately trying to figure out what's wrong with my code for several weeks. In trying to figure this out I started with the sample provided with the Framework SDK and figured I'd keep modifying it to act more like my component until it broke. Without any modification, it does exactly the same thing. Each invocation increases the amount of memory used by DLLHOST. The memory doesn't get freed until I shut down the queue app. Has anyone else experienced this? Is there an interop problem maybe? Or a setting I forgot to make? Any help will be appreciated. Thanks. John |
#3
| |||
| |||
|
|
Mike, It's the QueuedComponents sample (FrameworkSDK\Samples\Technologies\ComponentServic es\QueuedComponents\CS). I'm running it on Windows2000 Server SP4. My Framework is 1.0.3705. I built and installed it without modification using the build.bat file. Here's what it does for me: Start the QCDemoSvr COM+ application DLLHOST starts and takes 5,512k If I just let it sit, after a few minutes this drops to 3,324k Start QCDemo.exe DLLHOST Memory increases to 3,360k Click "Send Queued Msg" button Memory goes to 11,072k Respond to message Memory goes to 11,088k Click it again Memory goes to 11,124k Respond to message Memory goes to 11,128k Repeating this process continues to increase memory, although not consistently. Sometimes it goes up, sometimes it doesn't. And the increase is not consistent. Once it grabs the memory, though, it doesn't seem to let it go until the COM+ app is shut down. If I don't let it sit initially, the first click jumps to 11,776k. The behavior is pretty much the same. John "Mike Dice [MSFT]" <mikedice (AT) online (DOT) microsoft.com> wrote in message news:OcCO3gqVDHA.2104 (AT) TK2MSFTNGP10 (DOT) phx.gbl... You said you started with an SDK sample. Specifically what sample was it. Also please provide some platform information regarding which platform(s) you are running on. Thanks, Mike "Stingray" <nospam> wrote in message news:OaWJtiVUDHA.1572 (AT) TK2MSFTNGP12 (DOT) phx.gbl... No. When this happens, the server comes to a crawl. I can't attach a debugger or do anything useful except shut down the COM+ app (even that takes a few minutes to respond to the clicks). So I don't really know what's going on. John "Anatoly" <wiretransfers (AT) yahoo (DOT) com> wrote in message news:69b80dd6.0307230718.15d2260a (AT) posting (DOT) google.com... John, Do you have verification that each object actually finishes up properly upon completion of its task? -Anatoly "Stingray" <nospam> wrote in message news:<euaL$QzTDHA.1576 (AT) TK2MSFTNGP12 (DOT) phx.gbl>... I'm having problems with a Queued Component I wrote in C#. While running it keeps sucking up memory. Eventually it (DLLHOST.exe) gets to around 440MB and the server comes to a crawl. I've been desperately trying to figure out what's wrong with my code for several weeks. In trying to figure this out I started with the sample provided with the Framework SDK and figured I'd keep modifying it to act more like my component until it broke. Without any modification, it does exactly the same thing. Each invocation increases the amount of memory used by DLLHOST. The memory doesn't get freed until I shut down the queue app. Has anyone else experienced this? Is there an interop problem maybe? Or a setting I forgot to make? Any help will be appreciated. Thanks. John |
#4
| |||
| |||
|
|
I modified the test slightly and ran it on my XP Pro, SP1 machine (it has 1.1.4322 version of the CLR on it). What I did was changes the client so that every time I click the button it spins in a for loop 10,000 times creating an instance of the component and calling it's method. I also change the service object to comment out the MessageBox call (the only thing it's method does). I see the memory grow to about 14,000k then remain steady at about that level. At some point (not exactly sure how long since I had to go to a meeting) that drops back to 860k and sits like that until I push the button again (thus sending another 10,000) messages in. The drop back is the result of garbage collection of the instances that were created to service the requests. Keep in mind that the instances that serviced the requests are managed, garbage collected objects being called from a non-garbage collected (COM+) environment. Just because you call IUknown::Release on the wrapper object that wraps the managed object doesn't mean the managed object goes away immediately. It is made eligeable for garbage collection when you call IUnknown::Release on it's wrapper, but that doesn't mean it's immediately garbage collected. This is why you see memory usage grow with each instance. What you would expect is that it would continue to grow until the garbage collector felt it needed to start looking at cleaning things up, at that point, you'll see some more threads come online (which are doing the work of cleaning up objects) and you'll see the memory usage reach a steady state. After some relatively long period of inactivity you'll see the memory usage drop way back down as the gc does it's work. It is the garbage collector in the garbage collected environment that makes the decision of when to clean up the memory. Hope that helps, Mike "Stingray" <nospam> wrote in message news:ubjOJrrVDHA.2352 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Mike, It's the QueuedComponents sample (FrameworkSDK\Samples\Technologies\ComponentServic es\QueuedComponents\CS). I'm running it on Windows2000 Server SP4. My Framework is 1.0.3705. I built and installed it without modification using the build.bat file. Here's what it does for me: Start the QCDemoSvr COM+ application DLLHOST starts and takes 5,512k If I just let it sit, after a few minutes this drops to 3,324k Start QCDemo.exe DLLHOST Memory increases to 3,360k Click "Send Queued Msg" button Memory goes to 11,072k Respond to message Memory goes to 11,088k Click it again Memory goes to 11,124k Respond to message Memory goes to 11,128k Repeating this process continues to increase memory, although not consistently. Sometimes it goes up, sometimes it doesn't. And the increase is not consistent. Once it grabs the memory, though, it doesn't seem to let it go until the COM+ app is shut down. If I don't let it sit initially, the first click jumps to 11,776k. The behavior is pretty much the same. John "Mike Dice [MSFT]" <mikedice (AT) online (DOT) microsoft.com> wrote in message news:OcCO3gqVDHA.2104 (AT) TK2MSFTNGP10 (DOT) phx.gbl... You said you started with an SDK sample. Specifically what sample was it. Also please provide some platform information regarding which platform(s) you are running on. Thanks, Mike "Stingray" <nospam> wrote in message news:OaWJtiVUDHA.1572 (AT) TK2MSFTNGP12 (DOT) phx.gbl... No. When this happens, the server comes to a crawl. I can't attach a debugger or do anything useful except shut down the COM+ app (even that takes a few minutes to respond to the clicks). So I don't really know what's going on. John "Anatoly" <wiretransfers (AT) yahoo (DOT) com> wrote in message news:69b80dd6.0307230718.15d2260a (AT) posting (DOT) google.com... John, Do you have verification that each object actually finishes up properly upon completion of its task? -Anatoly "Stingray" <nospam> wrote in message news:<euaL$QzTDHA.1576 (AT) TK2MSFTNGP12 (DOT) phx.gbl>... I'm having problems with a Queued Component I wrote in C#. While running it keeps sucking up memory. Eventually it (DLLHOST.exe) gets to around 440MB and the server comes to a crawl. I've been desperately trying to figure out what's wrong with my code for several weeks. In trying to figure this out I started with the sample provided with the Framework SDK and figured I'd keep modifying it to act more like my component until it broke. Without any modification, it does exactly the same thing. Each invocation increases the amount of memory used by DLLHOST. The memory doesn't get freed until I shut down the queue app. Has anyone else experienced this? Is there an interop problem maybe? Or a setting I forgot to make? Any help will be appreciated. Thanks. John |
#5
| |||
| |||
|
|
Mike, Thanks for the explanation. That makes sense. I figured it had something to do with GC not being tied to Release. I didn't see the sample giving up memory but maybe it hasn't taken enough to trigger the GC. Ok, so maybe this explains the sample's behavior. But it still doesn't explain mine. On my "real" app, it runs for a while (a few minutes, maybe a few hours, processing anywhere from 1 to 10,000 messages). Then DLLHOST just suddenly starts sucking up memory in huge chunks (20M at a time). When it hits 440M or so, the server grinds to a halt and all activity slows to the point where the box is unusable. After long click and wait periods I can manage to shut down the app, the memory is freed and everything is back to normal. Strange. John "Mike Dice [MSFT]" <mikedice (AT) online (DOT) microsoft.com> wrote in message news:%23ywJFfsVDHA.2344 (AT) TK2MSFTNGP09 (DOT) phx.gbl... I modified the test slightly and ran it on my XP Pro, SP1 machine (it has 1.1.4322 version of the CLR on it). What I did was changes the client so that every time I click the button it spins in a for loop 10,000 times creating an instance of the component and calling it's method. I also change the service object to comment out the MessageBox call (the only thing it's method does). I see the memory grow to about 14,000k then remain steady at about that level. At some point (not exactly sure how long since I had to go to a meeting) that drops back to 860k and sits like that until I push the button again (thus sending another 10,000) messages in. The drop back is the result of garbage collection of the instances that were created to service the requests. Keep in mind that the instances that serviced the requests are managed, garbage collected objects being called from a non-garbage collected (COM+) environment. Just because you call IUknown::Release on the wrapper object that wraps the managed object doesn't mean the managed object goes away immediately. It is made eligeable for garbage collection when you call IUnknown::Release on it's wrapper, but that doesn't mean it's immediately garbage collected. This is why you see memory usage grow with each instance. What you would expect is that it would continue to grow until the garbage collector felt it needed to start looking at cleaning things up, at that point, you'll see some more threads come online (which are doing the work of cleaning up objects) and you'll see the memory usage reach a steady state. After some relatively long period of inactivity you'll see the memory usage drop way back down as the gc does it's work. It is the garbage collector in the garbage collected environment that makes the decision of when to clean up the memory. Hope that helps, Mike "Stingray" <nospam> wrote in message news:ubjOJrrVDHA.2352 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Mike, It's the QueuedComponents sample (FrameworkSDK\Samples\Technologies\ComponentServic es\QueuedComponents\CS). I'm running it on Windows2000 Server SP4. My Framework is 1.0.3705. I built and installed it without modification using the build.bat file. Here's what it does for me: Start the QCDemoSvr COM+ application DLLHOST starts and takes 5,512k If I just let it sit, after a few minutes this drops to 3,324k Start QCDemo.exe DLLHOST Memory increases to 3,360k Click "Send Queued Msg" button Memory goes to 11,072k Respond to message Memory goes to 11,088k Click it again Memory goes to 11,124k Respond to message Memory goes to 11,128k Repeating this process continues to increase memory, although not consistently. Sometimes it goes up, sometimes it doesn't. And the increase is not consistent. Once it grabs the memory, though, it doesn't seem to let it go until the COM+ app is shut down. If I don't let it sit initially, the first click jumps to 11,776k. The behavior is pretty much the same. John "Mike Dice [MSFT]" <mikedice (AT) online (DOT) microsoft.com> wrote in message news:OcCO3gqVDHA.2104 (AT) TK2MSFTNGP10 (DOT) phx.gbl... You said you started with an SDK sample. Specifically what sample was it. Also please provide some platform information regarding which platform(s) you are running on. Thanks, Mike "Stingray" <nospam> wrote in message news:OaWJtiVUDHA.1572 (AT) TK2MSFTNGP12 (DOT) phx.gbl... No. When this happens, the server comes to a crawl. I can't attach a debugger or do anything useful except shut down the COM+ app (even that takes a few minutes to respond to the clicks). So I don't really know what's going on. John "Anatoly" <wiretransfers (AT) yahoo (DOT) com> wrote in message news:69b80dd6.0307230718.15d2260a (AT) posting (DOT) google.com... John, Do you have verification that each object actually finishes up properly upon completion of its task? -Anatoly "Stingray" <nospam> wrote in message news:<euaL$QzTDHA.1576 (AT) TK2MSFTNGP12 (DOT) phx.gbl>... I'm having problems with a Queued Component I wrote in C#. While running it keeps sucking up memory. Eventually it (DLLHOST.exe) gets to around 440MB and the server comes to a crawl. I've been desperately trying to figure out what's wrong with my code for several weeks. In trying to figure this out I started with the sample provided with the Framework SDK and figured I'd keep modifying it to act more like my component until it broke. Without any modification, it does exactly the same thing. Each invocation increases the amount of memory used by DLLHOST. The memory doesn't get freed until I shut down the queue app. Has anyone else experienced this? Is there an interop problem maybe? Or a setting I forgot to make? Any help will be appreciated. Thanks. John |
#6
| |||
| |||
|
|
Did you call Marshal.ReleaseComObject(iQC) after you finish using the component in the client application?? thanks Anand Rajagopalan -- This posting is provided "AS IS" with no warranties, and confers no rights. "Stingray" <nospam> wrote in message news:eZSZB4uVDHA.3376 (AT) tk2msftngp13 (DOT) phx.gbl... Mike, Thanks for the explanation. That makes sense. I figured it had something to do with GC not being tied to Release. I didn't see the sample giving up memory but maybe it hasn't taken enough to trigger the GC. Ok, so maybe this explains the sample's behavior. But it still doesn't explain mine. On my "real" app, it runs for a while (a few minutes, maybe a few hours, processing anywhere from 1 to 10,000 messages). Then DLLHOST just suddenly starts sucking up memory in huge chunks (20M at a time). When it hits 440M or so, the server grinds to a halt and all activity slows to the point where the box is unusable. After long click and wait periods I can manage to shut down the app, the memory is freed and everything is back to normal. Strange. John "Mike Dice [MSFT]" <mikedice (AT) online (DOT) microsoft.com> wrote in message news:%23ywJFfsVDHA.2344 (AT) TK2MSFTNGP09 (DOT) phx.gbl... I modified the test slightly and ran it on my XP Pro, SP1 machine (it has 1.1.4322 version of the CLR on it). What I did was changes the client so that every time I click the button it spins in a for loop 10,000 times creating an instance of the component and calling it's method. I also change the service object to comment out the MessageBox call (the only thing it's method does). I see the memory grow to about 14,000k then remain steady at about that level. At some point (not exactly sure how long since I had to go to a meeting) that drops back to 860k and sits like that until I push the button again (thus sending another 10,000) messages in. The drop back is the result of garbage collection of the instances that were created to service the requests. Keep in mind that the instances that serviced the requests are managed, garbage collected objects being called from a non-garbage collected (COM+) environment. Just because you call IUknown::Release on the wrapper object that wraps the managed object doesn't mean the managed object goes away immediately. It is made eligeable for garbage collection when you call IUnknown::Release on it's wrapper, but that doesn't mean it's immediately garbage collected. This is why you see memory usage grow with each instance. What you would expect is that it would continue to grow until the garbage collector felt it needed to start looking at cleaning things up, at that point, you'll see some more threads come online (which are doing the work of cleaning up objects) and you'll see the memory usage reach a steady state. After some relatively long period of inactivity you'll see the memory usage drop way back down as the gc does it's work. It is the garbage collector in the garbage collected environment that makes the decision of when to clean up the memory. Hope that helps, Mike "Stingray" <nospam> wrote in message news:ubjOJrrVDHA.2352 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Mike, It's the QueuedComponents sample (FrameworkSDK\Samples\Technologies\ComponentServic es\QueuedComponents\CS). I'm running it on Windows2000 Server SP4. My Framework is 1.0.3705. I built and installed it without modification using the build.bat file. Here's what it does for me: Start the QCDemoSvr COM+ application DLLHOST starts and takes 5,512k If I just let it sit, after a few minutes this drops to 3,324k Start QCDemo.exe DLLHOST Memory increases to 3,360k Click "Send Queued Msg" button Memory goes to 11,072k Respond to message Memory goes to 11,088k Click it again Memory goes to 11,124k Respond to message Memory goes to 11,128k Repeating this process continues to increase memory, although not consistently. Sometimes it goes up, sometimes it doesn't. And the increase is not consistent. Once it grabs the memory, though, it doesn't seem to let it go until the COM+ app is shut down. If I don't let it sit initially, the first click jumps to 11,776k. The behavior is pretty much the same. John "Mike Dice [MSFT]" <mikedice (AT) online (DOT) microsoft.com> wrote in message news:OcCO3gqVDHA.2104 (AT) TK2MSFTNGP10 (DOT) phx.gbl... You said you started with an SDK sample. Specifically what sample was it. Also please provide some platform information regarding which platform(s) you are running on. Thanks, Mike "Stingray" <nospam> wrote in message news:OaWJtiVUDHA.1572 (AT) TK2MSFTNGP12 (DOT) phx.gbl... No. When this happens, the server comes to a crawl. I can't attach a debugger or do anything useful except shut down the COM+ app (even that takes a few minutes to respond to the clicks). So I don't really know what's going on. John "Anatoly" <wiretransfers (AT) yahoo (DOT) com> wrote in message news:69b80dd6.0307230718.15d2260a (AT) posting (DOT) google.com... John, Do you have verification that each object actually finishes up properly upon completion of its task? -Anatoly "Stingray" <nospam> wrote in message news:<euaL$QzTDHA.1576 (AT) TK2MSFTNGP12 (DOT) phx.gbl>... I'm having problems with a Queued Component I wrote in C#. While running it keeps sucking up memory. Eventually it (DLLHOST.exe) gets to around 440MB and the server comes to a crawl. I've been desperately trying to figure out what's wrong with my code for several weeks. In trying to figure this out I started with the sample provided with the Framework SDK and figured I'd keep modifying it to act more like my component until it broke. Without any modification, it does exactly the same thing. Each invocation increases the amount of memory used by DLLHOST. The memory doesn't get freed until I shut down the queue app. Has anyone else experienced this? Is there an interop problem maybe? Or a setting I forgot to make? Any help will be appreciated. Thanks. John |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |