Click to See Complete Forum and Search --> : memory management in VB


Styler
June 22nd, 2001, 11:03 AM
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

jgo
June 23rd, 2001, 10:13 AM
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.