Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

DLLHOST.EXE / COM+ memory problem

  • 26-04-2004 8:38am
    #1
    Registered Users, Registered Users 2 Posts: 249 ✭✭


    Hi all
    At work, we're having a resource problem with a production web app written in VB6. Not sure if this really belongs in the programming or OS areas, but I'll put it here and see if anyone has any suggestions...
    Thanks
    Frost
    ---
    We are experiencing an issue with the DLLHOST.exe and incremental memory usage. The entry point into our system is an ASP page (which is generated by a Visual Basic 6 Web Class) which in turn talks to various business and low level objects all written in Visual Basic and all running in COM+. A more detailed
    description of the structure of our system is available in the attached document.

    We have ensured that all of our COM+ components are built with the following properties on a component level:

    Instancing: 5 - MultiUse
    MTSTransactionMode: 1 - NoTransactions

    and the following properties on a project level:

    Unattended Execution True
    Retained in Memory True

    We thought initially that the memory usage issue was caused by COM+ objects not being killed correctly but we have now ensured that all COM+ objects are cleaned up (in Component Services no objects are shown to be Activated for our Application). We do
    not use the Class Initialize or Terminate events. We have also split out each component into its own COM+ package and so each component is run in a separate DLLHOST.exe. By checking the PID of the package we can see what component's DLLHOST.exe are
    increasing. While some DLLHOST.exes increases more than others, across the board even the simplest of our components increase.

    The memory usage consumed by the DLLHOST.exe that is associated with our COM+ package increases as our application is used, to eventually reach a point where it uses most of the resources on the server and the system grinds to a halt. As a workaround we
    have set the "Minutes Until Idle Shutdown" setting in Component Services to 0 which means that at least when there are any periods of inactivity on our system the DLLHOST.exe is killed thus ensuring that the system does not run out of resources. The downside of this approach is that the next user to use a component in COM+ will experience a slight performance hit as the DLLHOST.exe needs to be created again. On powerful servers this hit is negligible so we were willing to take this hit.
    However a system that we have in production at the moment does not experience any periods of inactivity and so the DLLHOST.exe does not get killed but instead keeps increasing.

    Two questions remain for us unanswered:

    (1) Is there something intrinsically wrong with the structure of our application. Do VB6 components run efficiently in COM+? Are there any issues with IIS talking to VB6 components that run in COM+ (any issues with marshalling etc etc)?

    (2) If the structure of our system is correct and all our
    objects are being killed correctly then what is using the resources?


Comments

  • Registered Users, Registered Users 2 Posts: 629 ✭✭✭str8_away


    We had the same problem but by doing the following our problem was solved.
    and the following properties on a project level:

    Unattended Execution True
    Retained in Memory True

    What is you "version compatbility" setting?

    Have you unregister your old component?
    Could your IIS might be still using old component?
    This is a good tool if you are not already using it
    http://www.4developers.com/com/index.htm


  • Registered Users, Registered Users 2 Posts: 640 ✭✭✭Kernel32


    I have used VB6 with COM+ in high transaction environments before and it works fine if setup correctly. It sounds like you have a memory leak or something is simply not releasing objects. Also just in case your using Oracle, don't run COM+ services and Oracle on the same box, it can be problematic and is not supported by Microsoft. Are you connecting to a database? If so which database and is your connection string always the same? Every unique connection string will cause a new connection pool to be created. Are you using any components outside your own that could be a problem? I would start by narrowing down the problem. Pick one component you know is the problem and build a test harness. Call the individual methods from the test harness and monitor the memory usage this should allow you to narrow things down a bit.


  • Registered Users, Registered Users 2 Posts: 249 ✭✭frost


    Originally posted by str8_away
    What is you "version compatbility" setting?

    Have you unregister your old component?
    Could your IIS might be still using old component?
    This is a good tool if you are not already using it
    http://www.4developers.com/com/index.htm [/B]

    Thanks for the suggestions.

    We are using Binary Compatibility.

    No chance of "old component" being used - we get same behaviour from a fully restarted system


  • Registered Users, Registered Users 2 Posts: 249 ✭✭frost


    Originally posted by Kernel32
    I have used VB6 with COM+ in high transaction environments before and it works fine if setup correctly. It sounds like you have a memory leak or something is simply not releasing objects. Also just in case your using Oracle, don't run COM+ services and Oracle on the same box, it can be problematic and is not supported by Microsoft. Are you connecting to a database? If so which database and is your connection string always the same? Every unique connection string will cause a new connection pool to be created. Are you using any components outside your own that could be a problem? I would start by narrowing down the problem. Pick one component you know is the problem and build a test harness. Call the individual methods from the test harness and monitor the memory usage this should allow you to narrow things down a bit.

    Yes, we definately have a memory leak. We've tracked it down to a single line of code, where the string property of one of our objects is assigned a value (a very large string). If you refresh the browser, that object's string property is reassigned, and the memory from the previous assignment is NOT RELEASED, even when the object is ultimately destroyed.

    Here is a simplified example:


    Function Test() as ObjA

    Dim a as ObjA

    a.xml = buildString '// A large string - this is what causes the problem

    set Test=a

    set a = Nothing

    End Function


  • Registered Users, Registered Users 2 Posts: 249 ✭✭frost


    Originally posted by str8_away
    We had the same problem but by doing the following our problem was solved.
    /B]

    Missed that - by doing WHAT exactly?
    Thanks
    F


  • Advertisement
Advertisement