CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2000
    Location
    London, England
    Posts
    89

    memory management in VB

    hello world

    I got this problem with an object and it’s starting to get on my nervous now. Basically I have this dll that uses an API of a very large third-party system, the problem is the API leaks memory (and I have got to work around this, ‘typical’). Now when this dll is called over and over again the memory use just increases until it blows the server, the Set Object = Nothing doesn’t release the memory only when the objects parent (e.g. form) is closed does the memory use drop. Now, a form doesn’t run the dll but a NT service either way the problem is still there. I need a way of aggressively killing an object as if I was the User, from within code. Any suggestion?

    I was thinking about using client impersonation using the create desktop API’s what do u all think?


    thanks allot
    Mark


  2. #2
    Join Date
    Jun 2001
    Location
    CO
    Posts
    3

    Re: memory management in VB

    Aggressively killing the object won't help, and I'm not so sure if unloading the Form is actually solving your problem, however,
    you could try to multi-thread it(not in the true sense of the word) by launching another ActiveX EXE and have it create your object. At least your object "lives" in that Active EXE's process space, and you have the power to "agressively" kill that process.
    Does anyone know if you've leaked memory...allocated memory in the heap(and didn't deallocate it)...does it deallocate that memory when the "parent" process is unloaded? My thought is that it doesn't. Once you've allocated it, its there to stay. If that's the case, then I don't think there's a way to manage your memory.
    Sorry.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured